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

26/03/2015 17:04

Error during web service call, calling Search.asmx from console applicatin

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

Here is nice article about this error, but my issue was I forgot to assign url to service instance. When I added it, code ran without problems

social.technet.microsoft.com/Forums/en-US/b64ce366-25df-4981-a2d4-d954ab86919e/queryservice-soapexception-attempted-to-perform-an-unauthorized-operation?forum=sharepointgenerallegacy


 QueryService service = new QueryService();
 service.Url = "https://mysitecollection/_vti_bin/search.asmx";
 service.Credentials = CredentialCache.DefaultCredentials;
  service.UseDefaultCredentials = true;