ServiceContractAttribute.CallbackContract Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the type of callback contract when the contract is a duplex contract.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
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.
'The following code contains an example of a duplex contract that contains a callback contract.
<ServiceContract(Name := "SampleContract", Namespace := "http://sample.service.contract", CallbackContract := GetType(IDuplexClient))> _
Public Interface IDuplexService
<OperationContract(IsOneWay := True)> _
Sub Order(ByVal name As String, ByVal quantity As Integer)
End Interface
<ServiceContract> _
Public Interface IDuplexClient
<OperationContract(IsOneWay := True)> _
Sub Receive(ByVal order As Order)
End Interface