Aracılığıyla paylaş


SoapHeaderBinding Sınıf

Tanım

XML Web hizmeti içindeki veya InputBinding öğesine eklenen bir OutputBinding genişletilebilirlik öğesini temsil eder.

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
Devralma
Türetilmiş
Öznitelikler

Örnekler

#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

Açıklamalar

XML Web hizmetleri için protokol belirtme hakkında daha fazla bilgi için bkz. ASP.NET Kullanan XML Web Hizmetleri. Web Hizmetleri Açıklama Dili (WSDL) hakkında daha fazla bilgi için bkz. WSDL belirtimi.

Oluşturucular

SoapHeaderBinding()

SoapHeaderBinding sınıfının yeni bir örneğini başlatır.

Özellikler

Encoding

SOAP üst bilgisini kodlamak için kullanılan kodlama stilini temsil eden bir URI alır veya ayarlar.

Fault

SOAP üst bilgisinin XML öğesi için headerfault WSDL belgesindeki çıkışı denetleye uzantı türünü alır veya ayarlar.

Handled

ServiceDescriptionFormatExtensionGenişletilebilirlik öğesi içeri aktarılırken içeri aktarma işlemi tarafından kullanılıp kullanılmayacağını gösteren bir değer alır veya ayarlar.

(Devralındığı yer: ServiceDescriptionFormatExtension)
MapToProperty

Örneğin oluşturulan ara sunucu sınıflarındaki belirli bir özelliğe eşlenip eşlenmediğini SoapHeaderBinding belirten bir değer alır veya ayarlar.

Message

Geçerli olduğu SoapHeaderBinding XML Web hizmeti içindeki öğesinin Message adını belirten bir değer alır veya ayarlar.

Namespace

Özellik tarafından özel olarak tanımlanmayan içeriğin kodlaması için belirtim konumunu temsil eden URI'yi Encoding alın veya ayarlar.

Parent

Öğesinin üst öğesini alır ServiceDescriptionFormatExtension .

(Devralındığı yer: ServiceDescriptionFormatExtension)
Part

XML Web hizmeti SoapHeaderBinding içinde hangi MessagePart değerin geçerli olduğunu belirten bir değer alır veya ayarlar.

Required

Başvurduğu eylem için gerekli olup olmadığını gösteren bir değer alır veya ayarlar ServiceDescriptionFormatExtension .

(Devralındığı yer: ServiceDescriptionFormatExtension)
Use

Üst bilginin özelliği tarafından Encoding belirtilen kurallar kullanılarak kodlanıp kodlanmayacağını veya somut bir XML şeması içinde kapsüllenip kapsüllenmeyeceğini belirtir.

Yöntemler

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır