Geeks With Blogs

News

qrcode

Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe


Lance's TextBox » About Me » My Resume »Twitter

It took me a while to figure out how to get a list of all the available fields for a particular type of list in SharePoint (for performing custom queries in SPQuery).  I was looking for a published list of these fields, which as far as I know does not exist.  Instead, you just use the GetList method of the Lists SOAP service.  Here’s an example SOAP request:

<?xml version="1.0" encoding="utf-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
  <SOAP-ENV:Body> 
    <GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/"> 
      <listName>Private Documents</listName> 
    </GetList> 
  </SOAP-ENV:Body> 
</SOAP-ENV:Envelope>

Just specify the name of the list you want the fields for as the value for the listName input element.

One easy way to work with SharePoint services remotely is by using /n software’s SharePoint Integrator developer toolkit.  Using its SPSite component in Visual Studio I can whip together a few lines of code to consume get the results from the aforementioned service:

spsite1.URL = "http://mysharepoint/mysite/";
spsite1.User = "DOMAIN\lancer";  
spsite1.Password = "password";  
spsite1.DescribeList("Private SharePoint Documents");; 

/n software SharePoint Integrator highlights:

    • Read, Write, and Create SharePoint Lists Items, Documents, and Attachments.
    • Programmatic control of SharePoint Sites, capabilities, and configuration
    • 128-bit strong SSL encryption keeps sensitive transaction information confidential.
    • Small and lightweight components with no dependencies on external libraries.
    • Native development components for all supported platforms and component technologies.
    • Unlimited free Email technical support backed by an experienced & professional staff.
    • Compatible with Microsoft Office SharePoint Server (MOSS), and Windows SharePoint Services v3.0 + (WSS).

 

Technorati Tags: ,
Posted on Monday, December 7, 2009 4:24 AM Programming | Back to top


Comments on this post: Listing SPQuery FieldNameRefs

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Lance Robinson | Powered by: GeeksWithBlogs.net