SoapHeader.EncodedMustUnderstand Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit la valeur de l'attribut XML mustUnderstand
de l'en-tête SOAP lors de communications utilisant le protocole SOAP version 1.1.
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
Valeur de propriété
Valeur de l'attribut mustUnderstand
. La valeur par défaut est "0".
Exceptions
Une valeur autre que "0", "1", "true" ou "false" est affectée à la propriété.
Exemples
// 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
Remarques
N'utilisez pas cette propriété. Utilisez plutôt la MustUnderstand propriété .