Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ServiceContractAttribute::Name Property

 

Gets or sets the name for the <portType> element in Web Services Description Language (WSDL).

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

public:
property String^ Name {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

The default value is the name of the class or interface to which the ServiceContractAttribute is applied.

Exception Condition
ArgumentNullException

The value is null.

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 example shows how to use the Name and Namespace properties of the ServiceContractAttribute to set the corresponding values in WSDL.

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

The following code example shows an Windows Communication Foundation (WCF) client for the preceding service that imported WSDL using the ServiceModel Metadata Utility Tool (Svcutil.exe). This client uses a HelloWorldProxy client rather than a SampleServiceProxy client (as is the case with the sample in the Example section of ServiceContractAttribute).

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 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2017 Microsoft