views:

1046

answers:

2

I have a custom web service deployed into WSS 3. It has two web methods.

The first one returns the version of the loaded assembly without any invocation of the SharePoint objects. The second returns some basic info about the library, something like:

var spLibrary = [find library logic];
return spLibrary.Name+"@"+spLibrary.Url;

In the client app I have something like the following:

var service = new WebService1();
service.Url = [url];
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

service.Method1();
service.Method2();

When the client app runs on the machine where SharePoint is deployed, everything works just fine.

When the client app runs on the remote machine (but under the same user) the first method still works, but the second one throws System.Net.WebException: HTTP 401: Unauthorized.

I have tried to set credentials manualy (service.Credentials = new System.Net.NetworkCredential(login, password, domain);) but this doesnt help.

I've tried to invoke the built in SharePoint web services using a similar scenario, and they work just fine: Sorry for the mistake... Some methods were not working fine without the appropriate privileges.

var service = new GroupsService(); 
service.Url = [url]; 
service.Credentials = System.Net.CredentialCache.DefaultCredentials; 

service.SomeMethod();
+1  A: 

The issue was resolved. The user, which account was used to interact with the sharepoint, got the site collection admin rights, and everything worked fine.

This was NOT a double-hop issue.

Hope this experience will help anybody else.

Here's the link to the MSDN forums' thread.

alekz
A: 

Is there a way to use a customize web service with a lower privileged account?? My problem is that Im working in an enterprise that cant give me the site collection administrator level, so Im looking for a way to develop a custom web service that dont use this level.

Searching in the SO, groups, I found a Sharepoint group named WSS_ADMIN_WPG and when I create a user in this group, it succesfully run the web service, I hope it helps for other people.

But, ¿is there annother way to run my customized web service with lower priviledges?

Alb