CallbackContract Property
Collapse the table of content
Expand the table of content

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.

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

'Declaration
Public Property CallbackContract As Type

Property Value

Type: System.Type
A Type that indicates the callback contract. The default is Nothing.

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


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft