다음을 통해 공유


SoapFaultBinding 클래스

정의

XML Web services 내에서 FaultBinding에 추가되는 확장성 요소를 나타냅니다.

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
상속
파생
특성

예제

#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

설명

이 클래스는 반환 된 모든 SOAP 오류 메시지의 내용을 지정 합니다.

XML 웹 서비스에 대한 프로토콜을 지정하는 방법에 대한 자세한 내용은 ASP.NET 사용하여 XML Web Services를 참조하세요. WSDL(Web Services Description Language)에 대한 자세한 내용은 WSDL 사양을 참조하세요.

생성자

SoapFaultBinding()

SoapFaultBinding 클래스의 인스턴스를 초기화합니다.

속성

Encoding

SOAP 오류 메시지를 인코딩하는 데 사용하는 인코딩 스타일을 나타내는 URI를 가져오거나 설정합니다.

Handled

확장성 요소를 가져올 때 ServiceDescriptionFormatExtension이 가져오기 프로세스에서 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 ServiceDescriptionFormatExtension)
Name

지정한 작업에 대해 정의된 WSDL 오류와 SOAP 오류를 연결하는 이름 특성의 값을 가져오거나 설정합니다.

Namespace

Encoding 속성에서 특별히 정의하지 않은 콘텐츠의 인코딩 사양 위치를 나타내는 URI를 가져오거나 설정합니다.

Parent

ServiceDescriptionFormatExtension의 상위를 가져옵니다.

(다음에서 상속됨 ServiceDescriptionFormatExtension)
Required

ServiceDescriptionFormatExtension이 참조하는 작업에 이것이 필요한지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 ServiceDescriptionFormatExtension)
Use

오류 메시지가 Encoding 속성에서 지정한 규칙을 사용하여 인코딩되는지 또는 구체적인 XML 스키마 내에 캡슐화되는지를 지정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상