Freigeben über


SoapFaultBinding.Encoding-Eigenschaft

Ruft den URI ab, der die Art der Codierung darstellt, mit dem die SOAP-Fehlermeldung codiert wurde, oder legt diesen fest.

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

Syntax

'Declaration
Public Property Encoding As String
'Usage
Dim instance As SoapFaultBinding
Dim value As String

value = instance.Encoding

instance.Encoding = value
public string Encoding { get; set; }
public:
property String^ Encoding {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Encoding ()

/** @property */
public void set_Encoding (String value)
public function get Encoding () : String

public function set Encoding (value : String)

Eigenschaftenwert

Eine Zeichenfolge, die einen URI enthält. Der Standardwert ist eine leere Zeichenfolge ("").

Hinweise

Der Wert dieser Eigenschaft darf nur dann festgelegt werden, wenn der Wert der Use-Eigenschaft Encoded ist.

Beispiel

' Create a new instance of 'SoapFaultBinding' class.
Dim mySoapFaultBinding As New 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'.
Dim myFaultBinding As New FaultBinding()
myFaultBinding.Name = "AddFaultbinding"
myFaultBinding.Extensions.Add(mySoapFaultBinding)
' Get existing 'OperationBinding' object.
myOperationBinding.Faults.Add(myFaultBinding)
myBinding.Operations.Add(myOperationBinding)
// Create a new instance of 'SoapFaultBinding' class.
SoapFaultBinding mySoapFaultBinding=new 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=new FaultBinding();
myFaultBinding.Name="AddFaultbinding";
myFaultBinding.Extensions.Add(mySoapFaultBinding);
// Get existing 'OperationBinding' object.
myOperationBinding.Faults.Add(myFaultBinding);
myBinding.Operations.Add(myOperationBinding);
// 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 );
// Create a new instance of 'SoapFaultBinding' class.
SoapFaultBinding mySoapFaultBinding = new SoapFaultBinding();
// Encode fault message using rules specified by 'Encoding' 
// property.
mySoapFaultBinding.set_Use(SoapBindingUse.Encoded);
// Set the URI representing the encoding style.
mySoapFaultBinding.set_Encoding("http://tempuri.org/stockquote");
// Set the URI representing the location of the specification 
// for encoding of content not defined by 'Encoding' property'.
mySoapFaultBinding.set_Namespace("http://tempuri.org/stockquote");
// Create a new instance of 'FaultBinding'.
FaultBinding myFaultBinding = new FaultBinding();
myFaultBinding.set_Name("AddFaultbinding");
myFaultBinding.get_Extensions().Add(mySoapFaultBinding);
// Get existing 'OperationBinding' object.
myOperationBinding.get_Faults().Add(myFaultBinding);
myBinding.get_Operations().Add(myOperationBinding);

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

SoapFaultBinding-Klasse
SoapFaultBinding-Member
System.Web.Services.Description-Namespace