Using the RPC method via the URL Protocol

Here is a game to play with fellow SharePoint addicts (don’t try it with your family…): list all the options you are aware of to retrieve the content of a SharePoint list. This could actually be an interesting way to kick off a SharePoint workshop with advanced users.

For me, the URL protocol of the RPC method is one of the most intriguing. In this post we are going to experiment with it. Then in my next post I’ll put it to work, to display random pictures on a SharePoint page.

The URL protocol

The URL protocol provides direct access to a specific content of your site (library or list). To me, it looks very similar to the REST methods proposed by other applications.

Let’s run a few experiments to better visualize the concept. For this you’ll need a SharePoint site with a couple libraries and lists. For example I’ll have the “Shared documents” library and a tasks list:
http://ThisServer/sites/ThisSite/shared%20documents
http://ThisServer/sites/ThisSite/Lists/Tasks

First experiment
In the address box of your browser, replace the library URL with this:
http://ThisServer/sites/ThisSite/_vti_bin/owssvr.dll?dialogview=FileOpen&location=shared%20documents
The browser will display the list of documents in your “Shared documents” library. You won’t be able to do much with this, but this is an easy way to show owssvr.dll at work.

Second experiment
– select a list on your site, for example the tasks list
– display the Web page source (from your browser: view | source)
– search for “o:WebQuerySourceHref”
– copy the URL next to it and paste it in your browser address box

The URL should look like this:
http://ThisServer/sites/ThisSite/_vti_bin/owssvr.dll?CS=65001&XMLDATA=1&RowLimit=0&List=3BE8E438-73BE-41D9-B0AA-35932ECF6579&View=D51A983F-1E26-4AC3-B67A-80876398C65A

And your browser should display an XML formatted view of your list (not user-friendly, but you should be able to recognize the content of your list).

The above example shows that lists and views in SharePoint are identified by unique numbers (GUID). You’ll need these numbers every time you want to use the URL protocol.

There is more to it than these basic examples. The URL protocol is very handy to get access to your content in a snap.

Some limitations

However, don’t see the URL protocol as a universal answer. There are several constraints that restrict its use. Here is a (certainly incomplete) list:
– Currently, the URL protocol doesn’t work with anonymous access. It seems to be a bug, according to this post:
http://blogs.flexnetconsult.co.uk/colinbyrne/2008/03/20/SharePointBugURLProtocolPromptsForAnonymousUsers.aspx
– You cannot use it in conjunction with the XML Web Part (this is also an authentication issue):
http://www.michaelmarkel.com/2008/03/error-using-xml-web-part-and-owssvrdll.html
– I was not able to make it work with some lookup fields
– You cannot apply customizations like grouping
– A warning about some parameters being case sensitive:
http://sharethelearning.blogspot.com/2008/02/some-owssvr-parameters-are-case.html

References

A couple years ago, it is thanks to blogs that I discovered the URL protocol. Here is an early reference from May 2004 (by Dustin Miller) that still applies:
http://www.sharepointblogs.com/dustin/archive/2007/06/22/don-t-forget-web-services-soap-isn-t-the-only-path-to-xml-from-sharepoint.aspx

Never too late to say thank you 🙂

A more recent post that includes interesting comments about the Query, FilterFieldn and FilterValuen parameters:
http://www.sharepointblogs.com/dwise/archive/2008/01/10/accessing-sharepoint-list-data-as-xml.aspx

And for a more complete reference, see the Microsoft WSS SDK:
http://msdn.microsoft.com/en-gb/library/ms478653.aspx

7 thoughts on “Using the RPC method via the URL Protocol

  1. Pingback: No assembly required « Path to SharePoint

  2. This is an awesome post! Would love to see this subject explored a bit more – e.g. how to pull information from another site using the URL protocol and filter it (using JavaScript) based on user selection. Love the random picture solution in your next post.

    Thanks for sharing!
    Greg

  3. Pingback: XML and Flash charts – FAQ « Path to SharePoint

  4. Pingback: OWSSVR.dll Sharepoint/MOSS « Niks's Blog

  5. Pingback: Teaser: pocketSOAP, an ultra lightweight library to interact with SharePoint SOAP services | Path to SharePoint

Comments are closed.