LocationServiceSoap.UpdateContact Method

Updates the specified contact in the contact list of the current user (the original submitter of the request).

Public Function UpdateContact (domainAlias As System.String, _      isActive As System.Boolean, _      notifyOnLocate As System.Boolean)

      _ As LocationServiceSoap.LocatableContact
[C#]
public LocationServiceSoap.LocatableContact UpdateContact (System.String domainAlias,      System.Boolean isActive,      System.Boolean notifyOnLocate);

Parameters

  • domainAlias
    The domain and alias of the contact for the current user, in the format "domain\user". The domainAlias parameter is required and must be passed as a string. For information about the maximum length of the domainAlias argument, see MapPoint Location Server Parameter Lengths.
  • isActive
    A flag that indicates whether this contact relationship is active.
  • notifyOnLocate
    A flag that indicate if the user should be notified when the contact tries to locate him or her. This flag is set to True if the user wants to receive a notification and False if the user does not. The default value of this parameter is True.

Remarks

This method returns an instance of LocatableContact class upon successfully updating an existing contact.

If the value of the domainAlias parameter is the same as the value of the contactDomainAlias parameter, a SelfReferentialContactException exception is thrown.

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
        'Update an existing contact for the current user
        Dim MyLocatableContact As LocatableContact = MyLocationService.UpdateContact("DOMAIN\contactuser", False, False)

    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
  {
   //Update the contact
   LocatableContact MyLocatableContact = MyLocationService.UpdateContact(@"DOMAIN\contactuser", false, false);
  }
  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

LocatableContact Class  |  Location Service Class  |  Using Soap Headers