Export (0) Print
Expand All

UnsubscribeType Class

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

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

[SerializableAttribute] 
[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
[XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/messages")] 
[DesignerCategoryAttribute("code")] 
[DebuggerStepThroughAttribute] 
public class UnsubscribeType : BaseRequestType
/** @attribute SerializableAttribute() */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
/** @attribute XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/messages") */ 
/** @attribute DesignerCategoryAttribute("code") */ 
/** @attribute DebuggerStepThroughAttribute() */ 
public class UnsubscribeType extends BaseRequestType
SerializableAttribute 
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/messages") 
DesignerCategoryAttribute("code") 
DebuggerStepThroughAttribute 
public class UnsubscribeType extends BaseRequestType

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


System.Object
   ExchangeWebServices.BaseRequestType
    ExchangeWebServices.UnsubscribeType

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.");
        }
        else
        {
            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)
Show:
© 2014 Microsoft