views:

779

answers:

2

I'm trying to consume the standard SharePoint web service GetWeb in the code-behind of an InfoPath form. The form is hosted as part of a workflow, so loaded inside the browser with Forms Services. It therefore runs on the credentials of the current user logged into SharePoint. The web service runs if the user is in the Owner group of the site but it gives an 'HTTP 401 Unauthorised' error if the user is in the Contributer or Reader groups. I also use the GetLists web service just after this but it runs provided the user has Reader permissions.

I only use the GetWeb call in order to get the WebId which the GetList call requires as a param. I got round my permissions problem by passing the WebId into the form opposed to having the form look it up. So all is okay now.

However, I would like to know why GetWeb requires higher permissions and how/if these permission's can be controlled. I've not found any documentation on the permissions that the different out of the box web services require, let alone how you change them.

[NOTE] I'm not using data connection files for a reason, but thankyou for suggesting them anyway.

A: 

If the site is a publishing site be sure that the doc library is published as well as any related resources. If that does not work take a look at this blog post it's helped me through a few WSS permission issues. I hope this helps.

James
+2  A: 

You can eliminate the need to hard coding web service credentials by managing the web service details in Data Connection libraries. The UDCX file includes the schema to store web service credentials and the file itself can be centrally managed from Central Admin.

Using data connection files in central admin: http://aidangarnish.net/blog/post/2008/11/Using-centrally-managed-SharePoint-data-connection-files-with-InfoPath-2007.aspx

Web service credentoils at (7): http://sheetal-d.spaces.live.com/Blog/cns!237C3DEA7120098B!658.entry

Ramu
I'm not using data connections as when I create them at design time, InfoPath insists on resolving 'localhost' to the physical development machine name. Hardly ideal for when it gets deployed to a live server.I'm still clueless however on how permission levels in WSS relate to web-service access.
Dan Revell