Solved

getDocsMetaInfo RPC call

Posted on 2011-03-17
2
654 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cannot connect to sqlserver 8 34
Import a txt file into a DataGridView and TextBox 20 52
vb.net and creating a class 5 20
SharePoint 2013 Table Moves 3 23
Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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