I'm using the sample code comes with WSS 3.0 SDK see below..
//The string containing the keyword to use in the search
string keywordString = "Microsoft";
//The XML string containing the query request information
//for the Web service
string qXMLString = "<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>";
QueryWebServiceProxy.QueryService queryService = new QueryWebServiceProxy.QueryService();
queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
System.Data.DataSet queryResults = queryService.QueryEx(qXMLString);
resultsGridView.DataSource = queryResults .Tables[0];
But its throws exception like this...
Server was unable to process request. ---> Attempted to perform an
unauthorized operation.
Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code.
Exception Details:
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> Attempted to perform an unauthorized
operation.
Source Error:
Line 142: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:Microsoft.Search/Registration", RequestNamespace="urn:Microsoft.Search", ResponseNamespace="urn:Microsoft.Search", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] Line 143: public string Registration(string registrationXml) { Line 144: object[] results = this.Invoke("Registration", new object[] { Line 145: registrationXml}); Line 146: return ((string)(results[0])); |
Can you help me in this?
Thanks in advance.
Jagad