Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

getDocsMetaInfo RPC call

Posted on 2011-03-17
2
Medium Priority
?
661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Russell_Venable earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 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