Share via


Requesting a Bing Maps Token

Important

On March 30, 2012, the Bing Maps Token Service will be retired. If you are an existing customer using tokens, please update your application to use Bing Maps Keys, which are the recommended authentication method for the Bing Maps AJAX Control 6.3, the Bing Maps Silverlight Control, the Bing Maps SOAP Services, the Bing Maps REST Services, and the Bing Spatial Data Services. To learn more about Bing Maps Keys, see Getting a Bing Maps Key and Migrating from Tokens to Keys. Information about transaction accounting provided by Bing Maps Keys is in Understanding Bing Maps Transactions.

To obtain a Bing Maps token for use in your Bing Maps SOAP Services or Bing Maps AJAX Control 6.3 application, you need to make a request to the Bing Maps Token Service.

Accessing the Token Service

Important

On March 30, 2012, the Bing Maps Token Service will be retired. Please use a Bing Maps Key to access Bing Maps APIs.

In order to access the Bing Maps Token Service, you must have a Bing Maps Platform Developer Account ID. To get a developer account ID, follow the steps below.

  1. Get a Windows Live ID at https://login.live.com. If you already have a Windows Live ID, you can use it instead of creating a new one.

  2. Sign up for a Bing Maps Platform developer account. Go to https://mappoint-css.live.com/mwssignup and sign up for a free evaluation developer account.

  3. Once you have received account creation confirmation email, you can manage your Bing Maps Platform developer account on the Bing Maps Customer Services site. You use your Windows Live ID to log in to the Bing Maps Customer Services site.

  4. On the Manage Account page of the Bing Maps Customer Services site you will find your Account ID. The Manage Password page allows you to set the password for this account ID.

  5. If you are using Visual Studio to build your application, then in your web application project add a web reference to the production Bing Maps Token Service. More information is found in the Referencing the Token Service section below.

  6. Set your account ID and account password in the Credentials property of the CommonServiceSoap Class before making requests to the Bing Maps Token Service using the CommonServiceSoap.GetClientToken Method.

  7. The CommonServiceSoap.GetClientToken Method returns a string, which is the Bing Maps Token Service. This token can be used in your Bing Maps SOAP Services or Bing Maps AJAX Control 6.3 application.

Referencing the Token Service

Token Service URLs

Production Environment

https://common.virtualearth.net/find-30/common.asmx?wsdl

To access the Production environment, you must be a licensed customer. Contact the Bing Maps Licensing Team for more information.

Note Activity in the production environment is billable. For more information about Billable Transactions, see the Viewing Bing Maps Token Transaction Reports topic.

Adding the Token Service as a Visual Studio Web Reference

The steps below outline adding a web reference to the Token Service from your Visual Studio project.

  1. Launch the Add Web Reference dialog. Select the Add Web Reference item from either the Project menu or the contextual menu for the project in the Solution Explorer.

    Note

    If you are using Visual Studio 2008 and Add Web Reference is not present in either the Project menu or the contextual menu for the project, do the following:

    a. Select the Add Service Reference menu item.

    b. Click on Advanced.

    c. Click on Add Web Reference.

  2. Enter the production Token Service URL from above for the Url and click Go.

  3. When prompted, enter your Bing Maps Developer Account ID and Password.

  4. Once the WSDL has been downloaded, give the web reference a name such as "TokenService". Click Add Reference.

Referencing the Bing Maps Web Services

Important

The recommended way to access the Bing Maps SOAP Services is by using a Bing Maps Key. For information about getting a Bing Maps Key, see Getting a Bing Maps Key.

If you are an existing customer using the token service to access the Bing Maps Web Services, use the following web service addresses to access the production environments. For more information about the Bing Maps Web Services, see the Bing Maps Web Services SDK.

Bing Maps Web Services Production Addresses

Service Name Production Environment

Geocode Service

https://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc

Imagery Service

https://dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc

Route Service

https://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc

Search Service

https://dev.virtualearth.net/webservices/v1/searchservice/searchservice.svc