SoapFaultBinding::Encoding Property

 

Gets or sets a URI representing the encoding style used to encode the SOAP fault message.

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

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

Property Value

Type: System::String^

A string containing a URI. The default value is an empty string ("").

The value of this property should be set only if the value of the Use property is Encoded.

// Create a new instance of 'SoapFaultBinding' class.
SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding;

// Encode fault message using rules specified by 'Encoding' property.
mySoapFaultBinding->Use = SoapBindingUse::Encoded;

// Set the URI representing the encoding style.
mySoapFaultBinding->Encoding = "http://tempuri.org/stockquote";

// Set the URI representing the location of the specification
// for encoding of content not defined by 'Encoding' property'.
mySoapFaultBinding->Namespace = "http://tempuri.org/stockquote";

// Create a new instance of 'FaultBinding'.
FaultBinding^ myFaultBinding = gcnew FaultBinding;
myFaultBinding->Name = "AddFaultbinding";
myFaultBinding->Extensions->Add( mySoapFaultBinding );

// Get existing 'OperationBinding' object.
myOperationBinding->Faults->Add( myFaultBinding );
myBinding->Operations->Add( myOperationBinding );

.NET Framework
Available since 1.1
Return to top
Show: