Tuesday, March 25, 2008

Error using XML Web Part and owssvr.dll

Today we wanted to get data from a SharePoint list and format it using some XSL. After some research I found people that said you could use OWSSVR.DLL and pass it certain parameters to filter the list and return only the data you want. The good thing about OWSSVR.DLL is that it is available at each site level and can pull data from any list and return the data in XML format.

Great! Now all we need to do is style it with XSL.

Not so fast!! The link to OWSSVR.dll is http://servername/sitename/_vti_bin/owssvr.dll. Try putting this into the XML web part and testing the link using the test link link. Good it returns the XML the way we want. Now try saving your XML web part settings and you will notice that you get an error about not being able to access the XML URL.

I did some more research and found that many people were having the same problem with OWSSVR.DLL and XML web parts. A couple of people suggested that it was a permission issue and that you could fix the problem. It appears to me as well to be a permission issue. When the web part tries to access the URL it uses the Web App Pool Id. One user suggested adding the Web App pool id to the IIS_WPG and WSS_WPG domain groups and that this would take care of the issue. I tried this and it did not seem to work. I still received the same error.

We ended up moving to the cSeg web part for rendering the list data. We would like to use OWSSVR.DLL in the future, so if anyone knows of a way to get past the error that the XML web part produces, any solution would be great.

Labels: , ,

3 Comments:

At August 3, 2008 at 2:27 AM , Anonymous Anonymous said...

kerberos related issue?

 
At August 3, 2008 at 5:41 PM , Blogger Michael Markel said...

We weren't using Kerberos in this installation. It was NTML authentication.

 
At July 8, 2009 at 9:32 AM , Blogger Andy said...

I ran up against the same. It seems to be a bug in sharepoint as you will get the problem even if you enable Anonymous access to the list itself

The workaround I finally settled on was to create an ASP file in a virtual directory that did allow anonymous access that connected into the list using XMLHTTP. Sample code below:

Response.ContentType = "text/xml"

thisURL = "http://myServer/SiteName/_vti_bin/owssvr.dll?Cmd=Display&List={ListGUID}&XMLDATA=TRUE"

' Creation of the xmlHTTP object
Set GetConnection = CreateObject("Microsoft.XMLHTTP")

' Connection to the URL
GetConnection.Open "get", thisURL, False, strUser, strPass
GetConnection.Send

ResponsePage = GetConnection.responseText
Response.write (ResponsePage)

Set GetConnection = Nothing

The nice thing is you can adapt it so you can simply pass in a query string with the list you want then to a lookup with all the GUIDs.

I used a machine local user/pass and stored it encrypted in the registry so there arent any credentials stored in the clear.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home