SoapHeaderBinding Class

 

Represents an extensibility element added to an InputBinding or an OutputBinding within an XML Web service.

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


<XmlFormatExtensionAttribute("header", "http://schemas.xmlsoap.org/wsdl/soap/",
	GetType(InputBinding), GetType(OutputBinding))>
Public Class SoapHeaderBinding
	Inherits ServiceDescriptionFormatExtension

NameDescription
System_CAPS_pubmethodSoapHeaderBinding()

Initializes a new instance of the SoapHeaderBinding class.

NameDescription
System_CAPS_pubpropertyEncoding

Gets or sets a URI representing the encoding style used to encode the SOAP header.

System_CAPS_pubpropertyFault

Gets or sets the extension type controlling the output in a WSDL document for the headerfault XML element of a SOAP header.

System_CAPS_pubpropertyHandled

Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is used by the import process when the extensibility element is imported.(Inherited from ServiceDescriptionFormatExtension.)

System_CAPS_pubpropertyMapToProperty

Gets or sets a value indicating whether the SoapHeaderBinding instance is mapped to a specific property in generated proxy classes.

System_CAPS_pubpropertyMessage

Gets or sets a value specifying the name of the Message within the XML Web service to which the SoapHeaderBinding applies.

System_CAPS_pubpropertyNamespace

Get or sets the URI representing the location of the specification for encoding of content not specifically defined by the Encoding property.

System_CAPS_pubpropertyParent
System_CAPS_pubpropertyPart

Gets or sets a value indicating to which MessagePart within the XML Web service the SoapHeaderBinding applies.

System_CAPS_pubpropertyRequired

Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is necessary for the action to which it refers.(Inherited from ServiceDescriptionFormatExtension.)

System_CAPS_pubpropertyUse

Specifies whether the header is encoded using rules specified by the Encoding property, or is encapsulated within a concrete XML schema.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

For more information about specifying protocols for XML Web services, see [<topic://cpconbuildingaspnetwebservices>]. For more information about Web Services Description Language (WSDL), see the specification at http://www.w3.org/TR/wsdl/.

Imports System
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 'Main
End Class 'MySampleClass

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: