Search Web Service not working in SharePoint 2007
Hi,
I am trying to access the web service provided by sharepoint 2007 and use it in the ASP.NET application. I want to use the following Web Service.
http://localhost/_vti_bin/search.asmx
http://localhost/_vti_bin/spsearch.asmx
And while executing the code, following error is being thrown.
Server was unable to process request. > Attempted to perform an unauthorized operation.
Following is the code I am using to access the Web Service.
Imports
SPSSearchImports System.Data
Partial
Class _DefaultInherits System.Web.UI.PageProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load
Try Dim keywordStringAsString ="Microsoft"
Dim qXMLStringAsString ="<QueryPacket xmlns='urn:Microsoft.Search.Query'><Query><SupportedFormats><Format revision='1'>urn:Microsoft.Search.Response.Document:Document</Format></SupportedFormats><Context><QueryText language='en-US' type='STRING'>" + keywordString +"</QueryText></Context></Query></QueryPacket>" Dim queryServiceAs QueryService =New QueryService()
queryService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim queryResultsAs DataSet =New DataSet
queryResults = queryService.QueryEx(qXMLString)
Catch exAs ExceptionResponse.Write(ex.Message.ToString())
EndTryEndSubEnd
ClassPlease let me know, if you encounter similar errors.
Thanks
John

