Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm building a web application that is based on Microsoft Search Server 2010 and uses its web services.

I need to be able to search as an anonymous user. So I have enabled anonymous access for my SP search center and am able to search there.

But when I call QueryService.Query method I get the error message:

Server was unable to process request. ---> Attempted to perform an unauthorized operation

To call the service I use this code:

QueryService service = new QueryService
{
   Credentials = CredentialsCache.DefaultCredentials
};

DataSet dataSet = service.QueryEx(query);

Where I can enable anonymous access for the web service?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Do you have multiple zones on your web application? If so, try calling the web service on a zone that does not have Anonymous access enabled. I came across this post a while back that shed some light onto it.

http://chrisdomino.com/Blog/Post/401-Reasons-Why-SharePoint-Web-Services-Don-t-Work-Anonymously?Length=4

share|improve this answer
    
But then It will ask credentials? –  Sly May 13 '11 at 6:18
    
Yes, you will need to have credentials using this method. We have had issues on our Anonymous site with other applications calling the web services. What we did is extend the zone and put Anonymous on an extended zone. Then we called the web service on a 'non anonymous' zone using credentials that had access to the content. –  Jason Jones May 13 '11 at 15:12
    
Is there any way to do this with Anonymous on? I'm actually trying the same thing using the New-WebServiceProxy in PowerShell. Scripting Guy notes it should work, my real life experience says otherwise. But all our sites are set with Anonymouns and Windows Integration on. Just wondering if this is still a dead end –  MichaelF Mar 8 '12 at 17:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.