ServiceContractAttribute.Name Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the name for the <portType> element in Web Services Description Language (WSDL).
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Property Value
Type: System.StringThe default value is the name of the class or interface to which the ServiceContractAttribute is applied.
| Exception | Condition |
|---|---|
| ArgumentNullException | The value is Nothing. |
| ArgumentOutOfRangeException | The value is an empty string. |
Use the Name and the Namespace properties to control the name and namespace of the <portType> element in WSDL.
'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
Show: