ConvertIdType Class

The ConvertIdType class represents a request to convert item and folder identifiers between supported Exchange formats.

Namespace: ExchangeWebServices
Assembly: EWS (in ews.dll)


<SerializableAttribute> _
<DesignerCategoryAttribute("code")> _
<GeneratedCodeAttribute("wsdl", "2.0.50727.42")> _
<DebuggerStepThroughAttribute> _
<XmlTypeAttribute(Namespace:="")> _
Public Class ConvertIdType
    Inherits BaseRequestType
[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
public class ConvertIdType : BaseRequestType
[GeneratedCodeAttribute(L"wsdl", L"2.0.50727.42")] 
public ref class ConvertIdType : public BaseRequestType
/** @attribute SerializableAttribute() */ 
/** @attribute DesignerCategoryAttribute("code") */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
/** @attribute DebuggerStepThroughAttribute() */ 
/** @attribute XmlTypeAttribute(Namespace="") */ 
public class ConvertIdType extends BaseRequestType
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
public class ConvertIdType extends BaseRequestType

Inheritance Hierarchy



The following example performs an identifier conversion between the Exchange Web Services identifier format and the Outlook Web Access identifier format.

static void ConvertId()
    // Set the version, credentials, and the Client Access server on ExchangeServiceBinding.
    ExchangeServiceBinding esb = new ExchangeServiceBinding();
    esb.RequestServerVersionValue = new RequestServerVersion();
    esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;
    esb.Credentials = new NetworkCredential("username", "password", "domain");
    esb.Url = "https://FQDN/ews/exchange.asmx";

    // Create the request.
    ConvertIdType request = new ConvertIdType();
    request.SourceIds = new AlternateIdType[1];
    request.SourceIds[0] = new AlternateIdType();

    // Convert from the Exchange Web Services identifier to an Outlook Web Access identifier.
    request.SourceIds[0].Format = IdFormatType.EwsId;
    (request.SourceIds[0] as AlternateIdType).Id = "AAMkADk";
    (request.SourceIds[0] as AlternateIdType).Mailbox = "";
    request.DestinationFormat = IdFormatType.OwaId;

        // Send the ConvertIdType request and get the response.
        ConvertIdResponseType response = esb.ConvertId(request);
        ArrayOfResponseMessagesType aormt = response.ResponseMessages;
        ResponseMessageType[] rmta = aormt.Items;

        // Check each response message.
        foreach (ConvertIdResponseMessageType resp in rmta)
            if (resp.ResponseClass == ResponseClassType.Success)
                ConvertIdResponseMessageType cirmt = (resp as ConvertIdResponseMessageType);
                AlternateIdType myId = (cirmt.AlternateId as AlternateIdType);

                string format = myId.Format.ToString();
                string identifier = myId.Id;
                string mailbox = myId.Mailbox;

                Console.WriteLine("Converted to format: {0}\r\nIdentifier: {1}\r\nMailbox: {2}", format, identifier, mailbox);
            else if (resp.ResponseClass == ResponseClassType.Error)
                Console.WriteLine("Error: " + resp.MessageText);
                Console.WriteLine("Warning: " + resp.MessageText);
    catch (Exception e)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003,

Target Platforms

Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Longhorn, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional with Service Pack 2 (SP2)