Solved

getDocsMetaInfo RPC call

Posted on 2011-03-17
2
650 Views
Last Modified: 2012-05-11
Can anyone provide a simple code example for using the getDocsMetaInfo RPC to retrieve property from a document in SharePoint.

Thanks
0
Comment
Question by:GlennCameron
2 Comments
 
LVL 15

Accepted Solution

by:
Russell_Venable earned 500 total points
ID: 35168274
Are you looking for a example like this?
string parameters =
"method=getDocsMetaInfo:6.0.n.nnnn&url_list=[global.asa]&listHiddenDocs=false&listLinkInfo=true"

HttpPost("http://the_site/_vti_bin/_vti_aut/author.dll", parameters);


string HttpPost (string uri, string parameters)

   WebRequest webRequest = WebRequest.Create (uri);
  
      webRequest.ContentType = "txt/html";
   webRequest.Method = "POST";
   byte[] bytes = Encoding.ASCII.GetBytes (parameters);
   Stream os = null;
   try
   { 
      webRequest.ContentLength = bytes.Length;
      os = webRequest.GetRequestStream();
      os.Write (bytes, 0, bytes.Length);        
   }
   catch (WebException ex)
   {
      MessageBox.Show ( ex.Message, "HttpPost: Request error", 
         MessageBoxButtons.OK, MessageBoxIcon.Error );
   }
   finally
   {
      if (os != null)
      {
         os.Close();
      }
   }
 
   try
   { 
      WebResponse webResponse = webRequest.GetResponse();
      if (webResponse == null) 
         { return null; }
      StreamReader sr = new StreamReader (webResponse.GetResponseStream());
      return sr.ReadToEnd ().Trim ();
   }
   catch (WebException ex)
   {
      MessageBox.Show ( ex.Message, "HttpPost: Response error", 
         MessageBoxButtons.OK, MessageBoxIcon.Error );
   }
   return null;

Open in new window



Microsoft reference

Demo library for FrontPage RPC Library
0
 
LVL 6

Expert Comment

by:judgeking
ID: 35170297
Here's how I'd do it:
string parameters =
"method=getDocsMetaInfo:6.0.n.nnnn&url_list=[global.asa]&listHiddenDocs=false&listLinkInfo=true"

HttpPost("http://the_site/_vti_bin/_vti_aut/author.dll", parameters);


string HttpPost (string uri, string parameters)
{ 	
   WebRequest webRequest = WebRequest.Create (uri);
  
      webRequest.ContentType = "txt/html";
   webRequest.Method = "POST";
   byte[] bytes = Encoding.ASCII.GetBytes (parameters);
   Stream os = null;
   try
   { 
      webRequest.ContentLength = bytes.Length;
      os = webRequest.GetRequestStream();
      os.Write (bytes, 0, bytes.Length);        
   }
   catch (WebException ex)
   {
      MessageBox.Show ( ex.Message, "HttpPost: Request error", 
         MessageBoxButtons.OK, MessageBoxIcon.Error );
   }
   finally
   {
      if (os != null)
      {
         os.Close();
      }
   }
 
   try
   { 
      WebResponse webResponse = webRequest.GetResponse();
      if (webResponse == null) 
         { return null; }
      StreamReader sr = new StreamReader (webResponse.GetResponseStream());
      return sr.ReadToEnd ().Trim ();
   }
   catch (WebException ex)
   {
      MessageBox.Show ( ex.Message, "HttpPost: Response error", 
         MessageBoxButtons.OK, MessageBoxIcon.Error );
   }
   return null;
}

Open in new window

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now