locked
The search request was unable to connect to the Search Service. RRS feed

  • Question

  • I am using SP 2010, search.asmx invoking from a windows application.

    the error is:

    The search request was unable to connect to the Search Service.

    HP.QueryService queryService = new HP.QueryService();
    
                queryService.UseDefaultCredentials = true;
    
                System.Data.DataSet queryResults = queryService.QueryEx(GetXMLString());
    
                dataGridView1.DataSource = queryResults.Tables[0];

    I tried with services.msc and lot more but still not working.

    What could be the solution?

    Friday, May 25, 2012 2:58 PM

Answers

  • It's likely not accepting the credentials.  Try passing the username and password as specific string values.
    • Marked as answer by SP10Dev Thursday, May 31, 2012 8:39 PM
    Friday, May 25, 2012 6:02 PM
  • Hi

    What does your web reference url look like ? Are you using this format?:  http://Server_Name/[sites]/[Site_Name]/_vti_bin/search.asmx


    Kind Regards Bjoern
    Blog


    • Edited by Bjoern H Rapp Friday, May 25, 2012 7:06 PM
    • Marked as answer by SP10Dev Thursday, May 31, 2012 8:39 PM
    Friday, May 25, 2012 7:03 PM
  • Ok, then let's check a couple of other common causes. 

    1) Check that the Search Service is associated with your site:

       Open Central Admin- Select the "Manage Web Applications link" under  "Applications Management" ,

       Then Select your web application and click the "Service Connections" link on the ribbon. Verify that the "Search Service Application" checkbox is checked.

    2) Check that the Indexing service is running:

        - Start->Control Panel->Administrative Tools->Computer management-Services and Applications

        - Start indexing service

    3) Verify that the service account running the Search Service is not expired.

    4) Check if there are any distinct errors in the Event Viewer after trying the service

    5) In your code, also try setting the queryService.PreAuthenticate property to true

       


    Kind Regards Bjoern
    Blog


    • Edited by Bjoern H Rapp Friday, May 25, 2012 8:09 PM
    • Marked as answer by SP10Dev Thursday, May 31, 2012 8:39 PM
    Friday, May 25, 2012 8:02 PM

All replies

  • It's likely not accepting the credentials.  Try passing the username and password as specific string values.
    • Marked as answer by SP10Dev Thursday, May 31, 2012 8:39 PM
    Friday, May 25, 2012 6:02 PM
  • I tried but still not working:

    HP.QueryService queryService = new HP.QueryService();
                queryService.Credentials = new NetworkCredential("user", "PWD", "domain");
    
                System.Data.DataSet queryResults = queryService.QueryEx(GetXMLString());
    
                dataGridView1.DataSource = queryResults.Tables[0];

    SAME ERROR: The search request was unable to connect to the Search Service.
    • Edited by SP10Dev Friday, May 25, 2012 6:55 PM
    Friday, May 25, 2012 6:54 PM
  • Hi

    What does your web reference url look like ? Are you using this format?:  http://Server_Name/[sites]/[Site_Name]/_vti_bin/search.asmx


    Kind Regards Bjoern
    Blog


    • Edited by Bjoern H Rapp Friday, May 25, 2012 7:06 PM
    • Marked as answer by SP10Dev Thursday, May 31, 2012 8:39 PM
    Friday, May 25, 2012 7:03 PM
  • Yes Bjoern.  I am using

    http://app-pc/_vti_bin/search.asmx

    Friday, May 25, 2012 7:24 PM
  • Ok, then let's check a couple of other common causes. 

    1) Check that the Search Service is associated with your site:

       Open Central Admin- Select the "Manage Web Applications link" under  "Applications Management" ,

       Then Select your web application and click the "Service Connections" link on the ribbon. Verify that the "Search Service Application" checkbox is checked.

    2) Check that the Indexing service is running:

        - Start->Control Panel->Administrative Tools->Computer management-Services and Applications

        - Start indexing service

    3) Verify that the service account running the Search Service is not expired.

    4) Check if there are any distinct errors in the Event Viewer after trying the service

    5) In your code, also try setting the queryService.PreAuthenticate property to true

       


    Kind Regards Bjoern
    Blog


    • Edited by Bjoern H Rapp Friday, May 25, 2012 8:09 PM
    • Marked as answer by SP10Dev Thursday, May 31, 2012 8:39 PM
    Friday, May 25, 2012 8:02 PM
  • I have done all these steps.. Still no luck!
    Sunday, May 27, 2012 9:47 PM
  • it appeared like prob with configuration. iran config wizard and now everything works fine.

    THANK YOU EVERYBODY

    • Edited by SP10Dev Thursday, May 31, 2012 8:40 PM
    Thursday, May 31, 2012 8:39 PM