SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I noticed a strange behavior when searching from IE and using the QueryEX/Query functions or the webservice.

I always get System.ServiceModel.CommunicationException when I use the webservice to search. But When I try the same search from website, I get valid results. Then if I go back and try the same search again using the webservice, I get valid results.

Nothing fancy here..

<QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000">
    <Query domain="QDomain">
        <SupportedFormats>
            <Format>urn:Microsoft.Search.Response.Document.Document</Format>
        </SupportedFormats>
        <Range>
            <Count>50</Count>
        </Range>
        <Context>
            <QueryText language="en-US" type="STRING">"testtext" Site:"http://sps-internal.net/it/Dept/Public/"</QueryText>
        </Context>
    </Query>
</QueryPacket>
share|improve this question
    
How are you calling the webservice? .NET code somewhere? – Kit Menke Aug 21 '13 at 19:46
    
Adding queryServiceSoapClient.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation; solved the issue. I didn't quite understand why that is the case though. – Vivek Aug 27 '13 at 18:46

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.