SoapBodyBinding.Namespace 属性

定义

获取或设置一个 URI,该 URI 表示 Encoding 属性未具体定义的内容编码规范的位置。

public:
 property System::String ^ Namespace { System::String ^ get(); void set(System::String ^ value); };
public string Namespace { get; set; }
member this.Namespace : string with get, set
Public Property Namespace As String

属性值

String

包含一个 URI 的字符串。

示例

SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding;
// Encode SOAP body using rules specified by the 'Encoding' property.
mySoapBodyBinding->Use = SoapBindingUse::Encoded;
// Set URI representing the encoding style for encoding the body.
mySoapBodyBinding->Encoding = "http://schemas.xmlsoap.org/soap/encoding/";
// Set the Uri representing the location of the specification
// for encoding of content not defined by 'Encoding' property'.
mySoapBodyBinding->Namespace = "http://tempuri.org/soapsvcmgr/";
myInputBinding->Extensions->Add( mySoapBodyBinding );
SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding();
// Encode SOAP body using rules specified by the 'Encoding' property.
mySoapBodyBinding.Use = SoapBindingUse.Encoded;
// Set URI representing the encoding style for encoding the body.
mySoapBodyBinding.Encoding="http://schemas.xmlsoap.org/soap/encoding/";
// Set the Uri representing the location of the specification
// for encoding of content not defined by 'Encoding' property'.
mySoapBodyBinding.Namespace="http://tempuri.org/soapsvcmgr/";
myInputBinding.Extensions.Add(mySoapBodyBinding);
Dim mySoapBodyBinding As New SoapBodyBinding()
' Encode SOAP body using rules specified by the 'Encoding' property.
mySoapBodyBinding.Use = SoapBindingUse.Encoded
' Set URI representing the encoding style for encoding the body.
mySoapBodyBinding.Encoding = "http://schemas.xmlsoap.org/soap/encoding/"
' Set the Uri representing the location of the specification 
' for encoding of content not defined by 'Encoding' property'.
mySoapBodyBinding.Namespace = "http://tempuri.org/soapsvcmgr/"
myInputBinding.Extensions.Add(mySoapBodyBinding)

注解

如果尚未设置属性值,此属性将返回空字符串 (“”) 。 The value should only be set if the value of the Use property is Encoded. 否则,将忽略属性值,从而导致 XML Web 服务出现意外行为。

适用于