How to: Add a Web Reference to the Query Web Service
Applies to: SharePoint Server 2010
When using Microsoft Visual Studio to create a client application, you can access the Web methods of the Query Web service by adding a Web reference to your client application project. When you add a Web reference for a Web service to your project, Visual Studio generates a proxy class that enables you to call the Web methods in the Web service.
Note
Client application in this context refers to an application that calls the Web service, such as a Microsoft ASP.NET Web application or a Windows Forms application.
To add a Web reference to the Query Web service
In Solution Explorer, right-click the name of your project, and then click Add Service Reference.
In the Add Service Reference dialog box, click Advanced.
In the Service Reference Settings dialog box, click Add Web Reference.
In the Add Web Reference dialog box, type http://SERVER/_vti_bin/search.asmx in the URL text field, replacing SERVER with the URL to the SharePoint site. Then, click Go.
When the Web service is located, the page for QueryService Web service is displayed in the main window of the Add Web Reference dialog box. Type QueryWebServiceProxy in the Web reference name field, and then click Add Reference.
See Also
Concepts
Walkthrough: Querying SharePoint Search From a Client Application