The Live Search Web Service application programming interface (API), version 1.1, is an Extensible Markup Language (XML) Web service that enables developers to programmatically submit queries to, and retrieve results from, the Live Search Engine.
Live Search Service Requirements
You must have the following resources to use the Live Search Web service:
-
A deployment computer with an Internet connection; the ability to send requests using the Simple Object Access Protocol (SOAP) 1.1 and the Hyper Text Transfer Protocol (HTTP 1.1); and the ability to parse XML.
-
Microsoft Visual Studio 2005 and the Microsoft .NET Framework (version 2.0 or later) installed on a computer to build and run the sample applications.
Note |
|---|
|
If the Live Search Web service is called from behind a proxy server that enforces limits on SOAP packet size, you may experience issues with sending and receiving large SOAP packets. For example, a call to the Live Search Web service that returns a large number of results may result in a large SOAP packet being sent. You may need to bypass the proxy, set the SOAP packet size limit very high, or limit the amount of data you are requesting.
The Live Search Web service is built on standards that are based on SOAP, XML, and WSDL technologies. It has been tested for environments using the .NET platform and Visual Studio .NET tools for Windows, Web, and Console application development. Other environments and toolkits have not been tested, but may work with the Live Search Web service platform. |
Accessing the Live Search Web Service SOAP API
The formal Web Service Description Language (WSDL) XML document defines the format of messages used by the Live Search Web service, and some default values that are supplied by the service if they are omitted from your source code. The service description is an agreement that defines the behavior of the Live Search Web service, and instructs developers how to interact with the service. Your development project must reference the Live Search Web service WSDL to access the SOAP API.
For example, follow these steps to access the Live Search Web service WSDL from Microsoft Visual Studio 2005:
-
From the File menu, choose New | Project.
-
Choose one of the Project Types; for example, Visual C# Projects.
-
From the Templates list, choose to create a new Windows Application, ASP.NET Application, Smart Device Application, or Console Application. These Project Types and Templates have been tested for this release; other Project Types and Templates may also work correctly with these instructions.
-
From the Solution Explorer tab, right-click References and, from the pop-up menu, select Add Web Reference.
Note: If you are using Visual Studio 2008, right click References and, from the pop-up menu, select Add Service Reference. Click Advanced on the Add Service Reference dialog box, then click Add Web Reference on the Service Reference Settings dialog box. Then proceed to the next step.
-
Type the following address in the URL text box: http://soap.search.msn.com/webservices.asmx?wsdl.
-
Click Go.
-
You can accept the default Web service name
com.msn.search.soap suggested in the Web reference name text box, or type your own name for the service in the text box. Click Add Reference to add the Web reference to your project.
Note |
|---|
The name you choose for your project and the name you choose for the Web service must be added as a using directive in Microsoft Visual C#. For example, if you choose the name WindowsLiveSearchAPISample for your Windows Application project and WindowsLiveSearch as the Web reference name, you would add the following to your declarations:using WindowsLiveSearchAPISample.WindowsLiveSearch; |
Provisioning Your Application
Now that you have added the Web reference to your project, you can begin developing your application. Each application requires a unique Application ID, which is supplied by the Developer Provisioning System.
Creating a New Application ID
Follow these steps to create an Application ID from the MSN Search Web Service Developer Provisioning System:
-
Point your browser to http://search.live.com/developer.
-
Click Create and Manage Application IDs.
-
Sign in with your Windows Live ID. If you do not have a Live ID, click Sign Up Now to create one. Live ID authentication is required to use the Developer Provisioning System.
-
Once you're signed in, click Get a new App ID to create a new Application ID for your application.
-
Type a friendly name for your application in the Application Name text box.
-
Read the Terms of Use and click I Accept to agree to these terms. If you do not agree to the Terms of Use, click I Do Not Accept. The Application ID that appears on the page will not be activated if you choose not to accept the Terms of Use.
-
Once you've accepted the Terms of Use, select and copy the Application ID and paste it into your code as the value for the AppID field on the SearchRequest object, as shown in the following example:
searchRequest.AppID = "B7E6E8142B4B81547C86B77161967D84882261A1";
Note |
|---|
|
Ensure that you use the unique Application ID provided by the Developer Provisioning System in place of the sample AppID shown above. |
Managing Application IDs
Follow these steps to edit or delete an Application ID from the MSN Search Web Service Developer Provisioning System:
-
Point your browser to http://search.live.com/developer.
-
Click Create and Manage Application IDs.
-
Sign in with your Windows Live ID. Live ID authentication is required to use the Developer Provisioning System.
-
Once you're signed in, you will see any applications you've created in the Applications list. To change the name of an application, click the Edit link to the right of the application information in the list. The edit application page appears. Type the new name for your application in the Application Name text box and click Save. If you decide not to edit the application name, click Cancel.
-
To delete an application from the Applications list, click the Delete link to the right of the application information in the list. A confirmation Message Box appears. Confirm that you want to delete this application by clicking OK to delete the application from the list and close the Message Box. Once you have deleted an application, any source code that uses the Application ID associated with the deleted application will be unable to reach the service.