SoapFaultBinding Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Stellt ein Erweiterungselement dar, das einem FaultBinding in einem XML-Webdienst hinzugefügt wurde.
public ref class SoapFaultBinding : System::Web::Services::Description::ServiceDescriptionFormatExtension
[System.Web.Services.Configuration.XmlFormatExtension("fault", "http://schemas.xmlsoap.org/wsdl/soap/", typeof(System.Web.Services.Description.FaultBinding))]
public class SoapFaultBinding : System.Web.Services.Description.ServiceDescriptionFormatExtension
[<System.Web.Services.Configuration.XmlFormatExtension("fault", "http://schemas.xmlsoap.org/wsdl/soap/", typeof(System.Web.Services.Description.FaultBinding))>]
type SoapFaultBinding = class
inherit ServiceDescriptionFormatExtension
Public Class SoapFaultBinding
Inherits ServiceDescriptionFormatExtension
- Vererbung
- Abgeleitet
- Attribute
Beispiele
#using <System.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Web::Services::Description;
int main()
{
try
{
// Input wsdl file.
String^ myInputWsdlFile = "SoapFaultBindingInput_cpp.wsdl";
// Output wsdl file.
String^ myOutputWsdlFile = "SoapFaultBindingOutput_cpp.wsdl";
// Initialize an instance of a 'ServiceDescription' object.
ServiceDescription^ myServiceDescription = ServiceDescription::Read( myInputWsdlFile );
// Get a SOAP binding object with binding name S"MyService1Soap".
Binding^ myBinding = myServiceDescription->Bindings[ "MyService1Soap" ];
// 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.
OperationBinding^ myOperationBinding = myBinding->Operations[ 0 ];
myOperationBinding->Faults->Add( myFaultBinding );
// Create a new wsdl file.
myServiceDescription->Write( myOutputWsdlFile );
Console::WriteLine( "The new wsdl file created is : {0}", myOutputWsdlFile );
Console::WriteLine( "Proxy could be created using command : wsdl {0}", myOutputWsdlFile );
}
catch ( Exception^ e )
{
Console::WriteLine( "Error occurred : {0}", e->Message );
}
}
using System;
using System.Web.Services.Description;
public class MySoapFaultBindingSample
{
public static void Main()
{
try
{
// Input wsdl file.
string myInputWsdlFile="SoapFaultBindingInput_cs.wsdl";
// Output wsdl file.
string myOutputWsdlFile="SoapFaultBindingOutput_cs.wsdl";
// Initialize an instance of a 'ServiceDescription' object.
ServiceDescription myServiceDescription =
ServiceDescription.Read(myInputWsdlFile);
// Get a SOAP binding object with binding name "MyService1Soap".
Binding myBinding=myServiceDescription.Bindings["MyService1Soap"];
// 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.
OperationBinding myOperationBinding=myBinding.Operations[0];
myOperationBinding.Faults.Add(myFaultBinding);
// Create a new wsdl file.
myServiceDescription.Write(myOutputWsdlFile);
Console.WriteLine("The new wsdl file created is :"
+myOutputWsdlFile);
Console.WriteLine("Proxy could be created using command : wsdl "
+ myOutputWsdlFile);
}
catch(Exception e)
{
Console.WriteLine("Error occurred : "+e.Message);
}
}
}
Imports System.Web.Services.Description
Public Class MySoapFaultBindingSample
Public Shared Sub Main()
Try
' Input wsdl file.
Dim myInputWsdlFile As String = "SoapFaultBindingInput_vb.wsdl"
' Output wsdl file.
Dim myOutputWsdlFile As String = "SoapFaultBindingOutput_vb.wsdl"
' Initialize an instance of a 'ServiceDescription' object.
Dim myServiceDescription As ServiceDescription = ServiceDescription.Read(myInputWsdlFile)
' Get a SOAP binding object with binding name "MyService1Soap".
Dim myBinding As Binding = myServiceDescription.Bindings("MyService1Soap")
' 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.
Dim myOperationBinding As OperationBinding = myBinding.Operations(0)
myOperationBinding.Faults.Add(myFaultBinding)
' Create a new wsdl file.
myServiceDescription.Write(myOutputWsdlFile)
Console.WriteLine("The new wsdl file created is :" + myOutputWsdlFile)
Console.WriteLine("Proxy could be created using command : wsdl /language:VB " + myOutputWsdlFile)
Catch e As Exception
Console.WriteLine("Error occurred : " + e.Message.ToString())
End Try
End Sub
End Class
Hinweise
Diese Klasse gibt den Inhalt einer zurückgegebenen SOAP-Fehlermeldung an.
Weitere Informationen zum Angeben von Protokollen für XML-Webdienste finden Sie unter XML Web Services Using ASP.NET. Weitere Informationen zur Beschreibungssprache für Webdienste (WSDL) finden Sie in der WSDL-Spezifikation .
Konstruktoren
| Name | Beschreibung |
|---|---|
| SoapFaultBinding() |
Initialisiert eine Instanz der SoapFaultBinding Klasse. |
Eigenschaften
| Name | Beschreibung |
|---|---|
| Encoding |
Dient zum Abrufen oder Festlegen eines URI, der die Codierungsart darstellt, die zum Codieren der SOAP-Fehlermeldung verwendet wird. |
| Handled |
Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob der ServiceDescriptionFormatExtension Importvorgang beim Importieren des Erweiterbarkeitselements verwendet wird. (Geerbt von ServiceDescriptionFormatExtension) |
| Name |
Dient zum Abrufen oder Festlegen des Werts des Namensattributes, das den Soap-Fehler auf den für den angegebenen Vorgang definierten wsdl-Fehler bezieht. |
| Namespace |
Dient zum Abrufen oder Festlegen des URI, der den Speicherort der Spezifikation für die Codierung von Inhalten darstellt, die nicht speziell von der Encoding Eigenschaft definiert sind. |
| Parent |
Ruft das übergeordnete Element der .ServiceDescriptionFormatExtension (Geerbt von ServiceDescriptionFormatExtension) |
| Required |
Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob dies ServiceDescriptionFormatExtension für die Aktion erforderlich ist, auf die sie verweist. (Geerbt von ServiceDescriptionFormatExtension) |
| Use |
Gibt an, ob die Fehlernachricht mithilfe von Regeln codiert wird, die von der Encoding Eigenschaft angegeben sind, oder in einem konkreten XML-Schema gekapselt wird. |
Methoden
| Name | Beschreibung |
|---|---|
| Equals(Object) |
Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht. (Geerbt von Object) |
| GetHashCode() |
Dient als Standardhashfunktion. (Geerbt von Object) |
| GetType() |
Ruft die Type der aktuellen Instanz ab. (Geerbt von Object) |
| MemberwiseClone() |
Erstellt eine flache Kopie der aktuellen Object. (Geerbt von Object) |
| ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. (Geerbt von Object) |