1

I've been facing a search problem when I try to do a search by POST using SOAP. When using just a search term, it works fine, but when I try to add the path criteria to limit the search results to the document library, it doesn't return a result.

Here is the XML I'm sending:

<?xml version="1.0" encoding="utf-8"?>
        <soap:Envelope
          xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
          xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
          xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
          <soap:Body>
            <Query xmlns='urn:Microsoft.Search'>
              <queryXml>
&lt;QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'&gt;
  &lt;Query domain='QDomain'&gt;
    &lt;SupportedFormats&gt;
      &lt;Format&gt;urn:Microsoft.Search.Response.Document.Document&lt;/Format&gt;
    &lt;/SupportedFormats&gt;
    &lt;Context&gt;
                &lt;QueryText language='en-US' type='STRING' &gt;<search term> Path:&quot;http:%2F%2F<server>%2Fmy%2F<library id>%2F<folder>&quot;&lt;/QueryText&gt;
    &lt;/Context&gt;
    &lt;TrimDuplicates&gt;true&lt;/TrimDuplicates&gt;
    &lt;EnableStemming&gt;true&lt;/EnableStemming&gt;
    &lt;Properties&gt;
        &lt;Property name='Author'/&gt;
        &lt;Property name='Path'/&gt;
        &lt;Property name='Rank'/&gt;
        &lt;Property name='Title'/&gt;
        &lt;Property name='Size'/&gt;
        &lt;Property name='Description'/&gt;
        &lt;Property name='Hithighlightedsummary'/&gt;
    &lt;/Properties&gt;&lt;/Query&gt; &lt;/QueryPacket&gt;
              </queryXml>
            </Query>
          </soap:Body>
        </soap:Envelope>

This is what I'm getting back from the server:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <QueryResponse 
            xmlns="urn:Microsoft.Search">
            <QueryResult>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;ResponsePacket 
                xmlns="urn:Microsoft.Search.Response"&gt;&lt;Response domain="QDomain"&gt;&lt;Status&gt;ERROR_NO_RESULTS_FOUND&lt;/Status&gt;&lt;DebugErrorMessage /&gt;&lt;/Response&gt;&lt;/ResponsePacket&gt;
            </QueryResult>
        </QueryResponse>
    </soap:Body>
</soap:Envelope>

Can you tell me what I'm doing wrong here?

  • Since it's 2013, have you tried REST instead? – Matthew McDermott Jun 4 '16 at 12:36
  • I would prefer to stay with this implementation if possible as the existing code uses this strategy. It would be something I would try later on if needed. – user54807 Jun 6 '16 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.