다음을 통해 공유


SoapHeaderBinding 클래스

정의

XML Web services의 InputBinding이나 OutputBinding에 추가된 확장성 요소를 나타냅니다.

public ref class SoapHeaderBinding : System::Web::Services::Description::ServiceDescriptionFormatExtension
[System.Web.Services.Configuration.XmlFormatExtension("header", "http://schemas.xmlsoap.org/wsdl/soap/", typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding))]
public class SoapHeaderBinding : System.Web.Services.Description.ServiceDescriptionFormatExtension
[<System.Web.Services.Configuration.XmlFormatExtension("header", "http://schemas.xmlsoap.org/wsdl/soap/", typeof(System.Web.Services.Description.InputBinding), typeof(System.Web.Services.Description.OutputBinding))>]
type SoapHeaderBinding = class
    inherit ServiceDescriptionFormatExtension
Public Class SoapHeaderBinding
Inherits ServiceDescriptionFormatExtension
상속
파생
특성

예제

#using <System.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;

int main()
{
   ServiceDescription^ myServiceDescription = ServiceDescription::Read( "SoapHeaderBindingInput_cpp.wsdl" );
   Binding^ myBinding = gcnew Binding;
   myBinding->Name = "MyWebServiceSoap";
   myBinding->Type = gcnew XmlQualifiedName( "s0:MyWebServiceSoap" );
   SoapBinding^ mySoapBinding = gcnew SoapBinding;
   mySoapBinding->Transport = "http://schemas.xmlsoap.org/soap/http";
   mySoapBinding->Style = SoapBindingStyle::Document;
   myBinding->Extensions->Add( mySoapBinding );
   OperationBinding^ myOperationBinding = gcnew OperationBinding;
   myOperationBinding->Name = "Hello";
   SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding;
   mySoapOperationBinding->SoapAction = "http://tempuri.org/Hello";
   mySoapOperationBinding->Style = SoapBindingStyle::Document;
   myOperationBinding->Extensions->Add( mySoapOperationBinding );

   // Create InputBinding for operation for the 'SOAP' protocol.
   InputBinding^ myInputBinding = gcnew InputBinding;
   SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding;
   mySoapBodyBinding->Use = SoapBindingUse::Literal;
   myInputBinding->Extensions->Add( mySoapBodyBinding );
   SoapHeaderBinding^ mySoapHeaderBinding = gcnew SoapHeaderBinding;
   mySoapHeaderBinding->Message = gcnew XmlQualifiedName( "s0:HelloMyHeader" );
   mySoapHeaderBinding->Part = "MyHeader";
   mySoapHeaderBinding->Use = SoapBindingUse::Literal;

   // Add mySoapHeaderBinding to 'myInputBinding' object.
   myInputBinding->Extensions->Add( mySoapHeaderBinding );

   // Create OutputBinding for operation for the 'SOAP' protocol.
   OutputBinding^ myOutputBinding = gcnew OutputBinding;
   myOutputBinding->Extensions->Add( mySoapBodyBinding );

   // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
   myOperationBinding->Input = myInputBinding;
   myOperationBinding->Output = myOutputBinding;
   myBinding->Operations->Add( myOperationBinding );
   myServiceDescription->Bindings->Add( myBinding );
   myServiceDescription->Write( "SoapHeaderBindingOut_cpp.wsdl" );
   Console::WriteLine( "'SoapHeaderBindingOut_cpp.wsdl' file is generated." );
   Console::WriteLine( "Proxy could be created using 'wsdl SoapHeaderBindingOut_cpp.wsdl'." );
}
   using System;
   using System.Web.Services.Description;
   using System.Collections;
   using System.Xml;

   public class MySampleClass
   {
   public static void Main()
   {
      ServiceDescription myServiceDescription =
         ServiceDescription.Read("SoapHeaderBindingInput_cs.wsdl");
      Binding myBinding = new Binding();
      myBinding.Name = "MyWebServiceSoap";
      myBinding.Type =new XmlQualifiedName("s0:MyWebServiceSoap");

      SoapBinding mySoapBinding =new SoapBinding();
      mySoapBinding.Transport="http://schemas.xmlsoap.org/soap/http";
      mySoapBinding.Style=SoapBindingStyle.Document;
      myBinding.Extensions.Add(mySoapBinding);

      OperationBinding myOperationBinding = new OperationBinding();
      myOperationBinding.Name = "Hello";

      SoapOperationBinding mySoapOperationBinding =
         new SoapOperationBinding();
      mySoapOperationBinding.SoapAction = "http://tempuri.org/Hello";
      mySoapOperationBinding.Style=SoapBindingStyle.Document;
      myOperationBinding.Extensions.Add(mySoapOperationBinding);

      // Create InputBinding for operation for the 'SOAP' protocol.
      InputBinding myInputBinding = new InputBinding();
      SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding();
      mySoapBodyBinding.Use = SoapBindingUse.Literal;
      myInputBinding.Extensions.Add(mySoapBodyBinding);
      SoapHeaderBinding mySoapHeaderBinding=new SoapHeaderBinding();
      mySoapHeaderBinding.Message=new XmlQualifiedName("s0:HelloMyHeader");
      mySoapHeaderBinding.Part="MyHeader";
      mySoapHeaderBinding.Use=SoapBindingUse.Literal;
      // Add mySoapHeaderBinding to 'myInputBinding' object.
      myInputBinding.Extensions.Add(mySoapHeaderBinding);
      // Create OutputBinding for operation for the 'SOAP' protocol.
      OutputBinding myOutputBinding = new OutputBinding();
      myOutputBinding.Extensions.Add(mySoapBodyBinding);

      // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
      myOperationBinding.Input = myInputBinding;
      myOperationBinding.Output = myOutputBinding;
      myBinding.Operations.Add(myOperationBinding);

      myServiceDescription.Bindings.Add(myBinding);
      myServiceDescription.Write("SoapHeaderBindingOut_cs.wsdl");
      Console.WriteLine("'SoapHeaderBindingOut_cs.wsdl' file is generated.");
      Console.WriteLine("Proxy could be created using "
                           +"'wsdl SoapHeaderBindingOut_cs.wsdl'.");
   }
}
Imports System.Web.Services.Description
Imports System.Collections
Imports System.Xml

Public Class MySampleClass
   Public Shared Sub Main()
      Dim myServiceDescription As ServiceDescription = _
                        ServiceDescription.Read("SoapHeaderBindingInput_vb.wsdl")
      Dim myBinding As New Binding()
      myBinding.Name = "MyWebServiceSoap"
      myBinding.Type = New XmlQualifiedName("s0:MyWebServiceSoap")

      Dim mySoapBinding As New SoapBinding()
      mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"
      mySoapBinding.Style = SoapBindingStyle.Document
      myBinding.Extensions.Add(mySoapBinding)

      Dim myOperationBinding As New OperationBinding()
      myOperationBinding.Name = "Hello"

      Dim mySoapOperationBinding As New SoapOperationBinding()
      mySoapOperationBinding.SoapAction = "http://tempuri.org/Hello"
      mySoapOperationBinding.Style = SoapBindingStyle.Document
      myOperationBinding.Extensions.Add(mySoapOperationBinding)

      ' Create InputBinding for operation for the 'SOAP' protocol.
      Dim myInputBinding As New InputBinding()
      Dim mySoapBodyBinding As New SoapBodyBinding()
      mySoapBodyBinding.Use = SoapBindingUse.Literal
      myInputBinding.Extensions.Add(mySoapBodyBinding)
      Dim mySoapHeaderBinding As New SoapHeaderBinding()
      mySoapHeaderBinding.Message = New XmlQualifiedName("s0:HelloMyHeader")
      mySoapHeaderBinding.Part = "MyHeader"
      mySoapHeaderBinding.Use = SoapBindingUse.Literal
      ' Add mySoapHeaderBinding to 'myInputBinding' object.
      myInputBinding.Extensions.Add(mySoapHeaderBinding)
      ' Create OutputBinding for operation for the 'SOAP' protocol.
      Dim myOutputBinding As New OutputBinding()
      myOutputBinding.Extensions.Add(mySoapBodyBinding)

      ' Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
      myOperationBinding.Input = myInputBinding
      myOperationBinding.Output = myOutputBinding
      myBinding.Operations.Add(myOperationBinding)

      myServiceDescription.Bindings.Add(myBinding)
      myServiceDescription.Write("SoapHeaderBindingOut_vb.wsdl")
      Console.WriteLine("'SoapHeaderBindingOut_vb.wsdl' file is generated.")
      Console.WriteLine("Proxy could be created using " + _
                        "'wsdl /language:VB SoapHeaderBindingOut_vb.wsdl'.")
   End Sub
End Class

설명

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

생성자

SoapHeaderBinding()

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

속성

Encoding

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

Fault

SOAP 헤더의 headerfault XML 요소에 대한 WSDL 문서에서 출력을 제어하는 확장 유형을 가져오거나 설정합니다.

Handled

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

(다음에서 상속됨 ServiceDescriptionFormatExtension)
MapToProperty

생성된 프록시 클래스의 특정 속성에 SoapHeaderBinding 인스턴스가 매핑되는지 여부를 나타내는 값을 가져오거나 설정합니다.

Message

Message이 적용되는 XML Web services의 SoapHeaderBinding 이름을 지정하는 값을 가져오거나 설정합니다.

Namespace

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

Parent

ServiceDescriptionFormatExtension의 상위를 가져옵니다.

(다음에서 상속됨 ServiceDescriptionFormatExtension)
Part

MessagePart이 적용되는 XML Web services의 SoapHeaderBinding를 나타내는 값을 가져오거나 반환합니다.

Required

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

(다음에서 상속됨 ServiceDescriptionFormatExtension)
Use

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

메서드

Equals(Object)

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상