1

I wrote a small program - it makes requests to the Microsoft Search Server (_vti_bin/search.asmx) web service, receives answers and display them. Format of request is STRING.

Query packet is here:

@"<QueryPacket xmlns='urn:Microsoft.Search.Query'>
      <Query>
          <SupportedFormats>
             <Format revision='1'> urn:Microsoft.Search.Response.Document:Document</Format>
          </SupportedFormats>
          <Context>
              <QueryText language='en' type='STRING'>{0}
              </QueryText>
              </Context>
              <ResultProvider>Default</ResultProvider>
              <Range>
                 <Count>10</Count>
              </Range>
           </Query>
    </QueryPacket>"

And making request code:

var queryService = new QueryWebServiceProxy.QueryService();
queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
MessageBox.Show(queryService.Query(GetXmlString()));

private string GetXmlString()
{
     return String.Format(QUERY_XML, queryTextBox.Text);
}

There are 2 types of response: DataSet and XML. I prefer to work with XML, but DataSet answer has more information than XML.

DataSet: WorkId, Rank, Title, Size, Path, Description, Write, SiteName, CollapsingStatus, HitHighlightedSummary, HitHighlightedProperty, ContentClass, IsDocument... XML: title, action, urlLink, Description, Date

Can I receive more information in XML format? Maybe tag "SupportedFormats" can help me?

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
Elena
  • 73
  • 1
  • 2
  • 9

0 Answers0