Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 663
  • Last Modified:

getDocsMetaInfo RPC call

Can anyone provide a simple code example for using the getDocsMetaInfo RPC to retrieve property from a document in SharePoint.

Thanks
0
GlennCameron
Asked:
GlennCameron
1 Solution
 
Russell_VenableCommented:
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
 
judgekingCommented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now