ServiceContractAttribute::CallbackContract Property

 

Gets or sets the type of callback contract when the contract is a duplex contract.

Namespace:   System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public:
property Type^ CallbackContract {
	Type^ get();
	void set(Type^ value);
}

Property Value

Type: System::Type^

A Type that indicates the callback contract. The default is null.

Specify an interface in the CallbackContract property that represents the required opposite contract in a two-way (or duplex) message exchange. This enables client applications to listen for inbound operation calls that the server-side service application can send independently of client activity. Callback contracts that have one-way operations represent calls from the service that the client can handle.

System_CAPS_noteNote

The ServiceContractAttribute attribute is ignored on callback contracts. To configure runtime behavior of callback objects, use the System.ServiceModel::CallbackBehaviorAttribute.

The following code example shows a service that specifies a callback contract, which indicates that a service of type IDuplexHello must have a correspondent that implements a service of type IHelloCallbackContract. In addition, IHelloCallbackContract implements a one-way callback method, enabling the service to call the client without waiting for a reply to support a distributed, event-driven client.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: