Share via


LocationServiceSoap Class

Contains methods and properties that you can use to determine the geographic position of a user carrying a locatable device such as a cell phone or a pager. This service is introduced with Microsoft® MapPoint® Location Server version 1.0 and combines MapPoint Web Service and location-based services.
The LocationServiceSoap proxy class can either be generated by using the WSDL.exe tool from the command line or can be added as a Web reference to your application using Microsoft® Visual Studio® .NET by binding to the WSDL document published as a part of MapPoint Location Server setup.

Public Class LocationServiceSoap Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
    Member of [Namespace]
[C#]
public class LocationServiceSoap : System.Web.Services.Protocols.SoapHttpClientProtocol
    Member of [Namespace]

Remarks

To use a LocationServiceSoap proxy class instance to invoke the methods of MapPoint Location Server Web Service, do the following:

Attach your enterprise network credentials to the proxy.

Attach the UserInfoLocationHeader SOAP header to the proxy class with expected culture information; if this header is not set, your default culture is used by the Web service methods.

Example

 
[Visual Basic]
    'Create a LocationServiceSoap proxy instance.
    Dim MyLocationService As New LocationServiceSoap
    'Create and add the credentials required to access the Web service. 
    'Use your enterprise user alias, domain and password.
    Dim MyCredentials As New NetworkCredential("user", "password", "domain")
    MyLocationService.Credentials = MyCredentials
    'Setting a User info header object is optional.
    Dim MyUserInfoLocationHeader As New UserInfoLocationHeader
    'Set the German culture so that you can get your 
    'results in that specific culture. 
    MyUserInfoLocationHeader.Culture = New CultureInfo("de-DE")
    'Set the header to the proxy class.
    MyLocationService.UserInfoLocationHeaderValue = MyUserInfoLocationHeader
    Try
        'Invoke your Location Service methods here.
    Catch MyException As System.Web.Services.Protocols.SoapException
        'Your exception processing goes here. 
    End Try

 
[C#]
  //Create a LocationServiceSoap proxy instance. 
  LocationService MyLocationService = new LocationService(); 
  //Create and add the credentials required to access the Web service. 
  //Use your enterprise user alias, domain, and password.
  NetworkCredential MyCredentials = new NetworkCredential("user", "password", "domain");
  MyLocationService.Credentials = MyCredentials; 
  //Setting a User info header object is optional.
  UserInfoLocationHeader MyUserInfoLocationHeader = new UserInfoLocationHeader(); 
  //Set the German culture so that you can get your results 
  //in that specific culture. 
  MyUserInfoLocationHeader.Culture = new CultureInfo("de-DE"); 
  //Set the header to the proxy class.
  MyLocationService.UserInfoLocationHeaderValue = MyUserInfoLocationHeader; 
  try 
  {
   //Invoke your Location Service methods here.
  } 
  catch(System.Web.Services.Protocols.SoapException MyException) 
  {
   //Your exception processing goes here. 
  } 

  
 

See Also

Location Service Members  |  LocationService members  |  UserInfoLocationHeader Class  |  Using Soap Headers