Posted on 17th February 20115 Responses
How to: Get a SharePoint 2010 Lists XML file

Quick TipThere will be times that you need to fetch the XML file that describes one of your lists in SharePoint 2010. One example that pops to mind is when working with the Lists.asmx web service. You will need to have a visual of the XML file in case you need to operate on the data of the list in more depth.

So how do you get the XML file that describes a SharePoint 2010 list? Easy. You feed its URL to your browser and you’re promptly offered a dialog box to keep an offline version of the file.

Before you can use the following URL, you need to go fetch your list’s GUID. In case you do not know how to get a SharePoint 2010 List GUID follow the previous link.

If you do already have your list GUID, all you have to do it to replace the appropriate values (in bold) in the following URL string and pass it to your web browser:

http://serverName/sites/siteName/_vti_bin/owssvr.dll?Cmd=Display&List=GUID&XMLDATA=TRUE

I think that the whole line should also work in case you substituted GUID for the URL Encoded ID of the list GUID but it definitely works if you use the GUID as proposed in the aforementioned post. As soon as you have fed that line in the browser, the download dialog will display a request to download the xml file. You can then open or save it as you wish.

Comments
comment by adriyas
Posted on July 19, 2011 at 17:32

Nice tip. Keep up the good work! And thanks!

comment by Mauricio
Posted on January 13, 2012 at 18:09

How can I get the XML that represents the SharePoint 2010 List, but not as a file, I need to display that info into the browser?

Thank you

comment by MGR
Posted on January 17, 2012 at 17:07

Thank you for your comment Mauricio, and please accept my apologies for the late reply. Truth be told, I never tried to display the data directly from the “owssvr.dll”. I gave it a go just now, after I read your comment, and I didn’t manage to get it to work. I normally access the owssver.dll and save the file before I open it. A much more complete blog post about the use of this .dll can be found here. I may get back to checking this out later on but for now, I guess, we’ll have to stick with the offline .xml file that is being served by this Front Page – Remote Procedure Call.
Cheers.

comment by Nara
Posted on January 27, 2012 at 18:44

We ran into this as well. The difference in what the rpc protocol returns (data vs an xml file) is a change in browser file handling which is a setting on the web application.

SharePoint 2010 has a new opetion under the general settings of web applications that controls browser file handling. Try changing it to Permissive from Strict (default).

The new option explanation from TechNet:

Browser File Handling

You can specify whether additional security headers are added to documents that are served to Web browsers. These security headers specify that a browser shows a download prompt for certain types of files (for example, .html), and to use the server’s specified Multipurpose Internet Mail Extensions (MIME) type for other types of files.

The Permissive setting specifies that no headers are added. The Strict setting adds headers that force the browser to download certain types of files. The forced download improves security for the server by disallowing the automatic execution of Web content. By default, the setting is Strict.

Configure settings for a web application (SP 2010) TechNet:

http://technet.microsoft.com/en-us/library/cc262107.aspx

Leave a Response
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>