Share via


LocationServiceSoap.GetUserInfo Method

Returns the current user's information as an instance of the LocatableUser class.

Public Function GetUserInfo ()

      _ As LocationServiceSoap.LocatableUser
[C#]
public LocationServiceSoap.LocatableUser GetUserInfo ();

Remarks

If no matches are found, null (Nothing in Microsoft® Visual Basic® .NET) is returned.

If you want to check only user properties such as Visible, NotifyOnNewContact, and so on, use the methods that are specifically designed to retrieve these properties (such as GetNewContactNotification, GetVisibility and so on). By doing so, you can avoid the performance overhead associated with retrieving all contact lists for the current user.

This method accepts the following SOAP headers:

UserInfoLocationHeader—Used to establish the current user's (the user that is invoking the location service) specific information, such as culture and so on. When this SOAP header is not provided, the current user's default culture is applied. For more information, see UserInfoLocationHeader Class.

ClientIdHeader—Not used with MapPoint Location Server 1.0.

Because this is a Web service, all exceptions appear as SOAP exceptions. For more information, see the S oapException.Detail property.

Example

 
[Visual Basic]
    'Create a LocationServiceSoap proxy instance.
    Dim MyLocationService As New LocationServiceSoap
    'Create and add the credentials required to access the Web service.
    Dim MyCredentials As New NetworkCredential("user", "password", "DOMAIN")
    MyLocationService.Credentials = MyCredentials

    Try
        'Get the user information for the current user
        Dim MyLocatableUser As LocatableUser = MyLocationService.GetUserInfo()


    Catch MyException As SoapException
        'Your exception processing goes here.
        If ((Not MyException.Detail Is Nothing) And (Not MyException.Detail("Type") Is Nothing)) Then
            MessageBox.Show(MyException.Detail("Type").InnerText)
        End If

    Finally
        'Your cleanup goes here
        MyLocationService = Nothing
    End Try


 
[C#]
  //Create a LocationServiceSoap proxy instance.
  LocationServiceSoap MyLocationService = new LocationServiceSoap();
  //Create and add the credentials required to access the Web service.
  NetworkCredential MyCredentials = new NetworkCredential("user", "password", "DOMAIN");
  MyLocationService.Credentials = MyCredentials;

  try
  {
   //Get the current user information
   LocatableUser MyLocatableUser = MyLocationService.GetUserInfo();
   //Process the user information.
  }
  catch(SoapException MyException)
  {
   //Your exception processing goes here.
   if (MyException.Detail != null && MyException.Detail["Type"] != null)
    MessageBox.Show(MyException.Detail["Type"].InnerText);
  }
  finally
  {
   //Your cleanup goes here
   MyLocationService = null;
  }
 
  
 

See Also

LocatableUser Class  |  UserInfoLocationHeader Class  |  Location Service Class  |  Provisioned User Definition  |  Contact Definition  |  Using Soap Headers