SoapHeader.EncodedMustUnderstand 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当与 SOAP 协议 1.1 版通信时,获取或设置 SOAP 标头的 mustUnderstand
XML 特性值。
public:
property System::String ^ EncodedMustUnderstand { System::String ^ get(); void set(System::String ^ value); };
public string EncodedMustUnderstand { get; set; }
member this.EncodedMustUnderstand : string with get, set
Public Property EncodedMustUnderstand As String
属性值
mustUnderstand
特性的值。 默认为“0”。
例外
属性设置为“0”、“1”、“true”或“false”之外的值。
示例
// MyHeader class is derived from the SoapHeader class.
MyHeader ^ customHeader = gcnew MyHeader;
customHeader->MyValue = "Header value for MyValue";
// Set the EncodedMustUnderstand property to true.
customHeader->EncodedMustUnderstand = "1";
WebService_SoapHeader_EncodedMustUnderstand ^ myWebService = gcnew WebService_SoapHeader_EncodedMustUnderstand;
myWebService->myHeader1 = customHeader;
String^ results = myWebService->MyWebMethod1();
Console::WriteLine( results );
try
{
results = myWebService->MyWebMethod2();
}
catch ( Exception^ myException )
{
Console::WriteLine( "Exception raised in MyWebMethod2." );
Console::WriteLine( "Message: {0}", myException->Message );
}
// MyHeader class is derived from the SoapHeader class.
MyHeader customHeader = new MyHeader();
customHeader.MyValue = "Header value for MyValue";
// Set the EncodedMustUnderstand property to true.
customHeader.EncodedMustUnderstand = "1";
WebService_SoapHeader_EncodedMustUnderstand myWebService =
new WebService_SoapHeader_EncodedMustUnderstand();
myWebService.MyHeaderValue = customHeader;
string results = myWebService.MyWebMethod1();
Console.WriteLine(results);
try
{
results = myWebService.MyWebMethod2();
}
catch(Exception myException)
{
Console.WriteLine("Exception raised in MyWebMethod2.");
Console.WriteLine("Message: " + myException.Message);
}
' MyHeader class inherits from the SoapHeader class.
Dim customHeader As New MyHeader()
customHeader.MyValue = "Header value for MyValue"
' Set the EncodedMustUnderstand property to true.
customHeader.EncodedMustUnderstand = "1"
Dim myWebService As New WebService_SoapHeader_EncodedMustUnderstand()
myWebService.MyHeaderValue = customHeader
Dim results As String = myWebService.MyWebMethod1()
Console.WriteLine(results)
Try
results = myWebService.MyWebMethod2()
Catch myException As Exception
Console.WriteLine("Exception raised in MyWebMethod2.")
Console.WriteLine("Message: " & myException.Message)
End Try
注解
请勿使用此属性。 请改用该 MustUnderstand 属性。