Bing Maps Web Services Metadata

The Bing Maps Web Services are a set of web services built using Windows Communication Foundation (WCF) (http://msdn.microsoft.com/en-us/library/ms735119.aspx). The Bing Maps Web Services conform to WS-Basic Profile 1.1 (http://www.ws-i.org/Profiles/BasicProfile-1.1.html). The four services are geocode, imagery, route, and search. To use these services you must reference them in your development project to generate a set of client proxy classes. It is highly recommended that you use the ServiceModel Metadata Utility Tool (svcutil.exe) or Visual Studio 2008 to generate the service proxy classes for the Bing Maps Web Services. See the Generating Client Proxy Classes topic for more information.

Service Metadata

To call one of the Bing Maps Web Services, you need to generate proxy classes on your client. This is described in detail in the Generating Client Proxy Classes topic. If you are using Visual Studio 2008, use the svcutil.exe command-line utility (http://msdn.microsoft.com/en-us/library/aa347733.aspx) or add service references to the Bing Maps Web Services from the Visual Studio user interface. The Bing Maps Web Services metadata defines the format of messages that the Bing Maps Web Services send and receive.

You can use either the standard HTTP protocol or the HTTPS Secure Sockets Layer (SSL) protocol to call the Bing Maps Web Services. Note that using the SSL protocol adds latency for each call to the Bing Maps Web Services. The latency duration depends on how the SSL infrastructure is implemented on your servers; the minimum additional latency is five milliseconds.

Using HTTP Protocol

The following table lists the production service metadata URLs for each of the Bing Maps Web Services. Note that you will need to have valid credentials to make production service calls. More information about getting and setting credentials can be found in the Accessing the Bing Maps Web Services topic.

Service NameProduction Service Metadata URL

Geocode Service

http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl

Imagery Service

http://dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc?wsdl

Route Service

http://dev.virtualearth.net/webservices/v1/routeservice/routeservice.svc?wsdl

Search Service

http://dev.virtualearth.net/webservices/v1/searchservice/searchservice.svc?wsdl

Using HTTPS Secure Socket Layer (SSL) Protocol

If you want to send and receive Bing Maps Web Services requests using Secure Socket Layer (SSL), follow the steps below.

  1. Generate proxy classes using the service metadata URLs listed above by adding a service reference using the Visual Studio User Interface or by using the svcutil.exe tool. More information about this is found in the Generating Client Proxy Classes topic.

  2. Edit the service endpoint address URLs found in your configuration file to begin with "https" instead of "http".

  3. If you are using Visual Studio 2008 and the .NET Framework 3.0, you also need to change the BasicHttpSecurityMode to Transport. To do this, either set the mode of the security tag in your Visual Studio 2008 configuration file to Transport, or initialize your service variable with this security mode.

<!-- Visual Studio 2008 configuration settings for SSL -->
<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding name="BasicHttpBinding_IImageryService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <security mode="Transport">
               <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
               <message clientCredentialType="UserName" algorithmSuite="Default" />
            </security>
         </binding>
      </basicHttpBinding>
   </bindings>
   <client>
      <endpoint address="https://dev.virtualearth.net/WebServices/v1/ImageryService/ImageryService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IImageryService" contract="IImageryService" name="BasicHttpBinding_IImageryService" />
   </client>
</system.serviceModel>
// Instead of setting the security mode in the configuration file, 
//    initialize the service client variable with the Transport
//    security mode.
SearchServiceClient client = new SearchServiceClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress("https://dev.virtualearth.net/webservices/v1/searchservice/searchservice.svc");
See Also

Concepts

Generating Client Proxy Classes

Page view tracker