This documentation is archived and is not being maintained.

UnsubscribeType Class

The UnsubscribeType class represents a request to end a pull notification subscription.

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

[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
public class UnsubscribeType : BaseRequestType
/** @attribute SerializableAttribute() */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
/** @attribute XmlTypeAttribute(Namespace="") */ 
/** @attribute DesignerCategoryAttribute("code") */ 
/** @attribute DebuggerStepThroughAttribute() */ 
public class UnsubscribeType extends BaseRequestType
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
public class UnsubscribeType extends BaseRequestType

We recommend that you intentionally end a subscription instead of letting a subscription time out.


The following example shows you how to end a single subscription.

static void Unsubscribe(ExchangeServiceBinding esb)
    // Create the request by using a subscription ID.
    UnsubscribeType request = new UnsubscribeType();
    request.SubscriptionId = "a87a6b81-cf30-4fa0-b86a-6c66ff902123";

    // Send the request and get the response.
    UnsubscribeResponseType response = esb.Unsubscribe(request);

    ArrayOfResponseMessagesType aormt = response.ResponseMessages;
    ResponseMessageType[] rmta = aormt.Items;

    foreach (ResponseMessageType rmt in rmta)
        if (rmt.ResponseClass == ResponseClassType.Success)
            Console.WriteLine("Subscription ended successfully.");
            Console.WriteLine("Unsubscribe failed.");

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)