SoapHeaderBinding Class
Represents an extensibility element added to an InputBinding or an OutputBinding within an XML Web service.
System.Web.Services.Description.ServiceDescriptionFormatExtension
System.Web.Services.Description.SoapHeaderBinding
System.Web.Services.Description.Soap12HeaderBinding
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in System.Web.Services.dll)
The SoapHeaderBinding type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Encoding | Gets or sets a URI representing the encoding style used to encode the SOAP header. |
![]() | Fault | Gets or sets the extension type controlling the output in a WSDL document for the headerfault XML element of a SOAP header. |
![]() | Handled | Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is used by the import process when the extensibility element is imported. (Inherited from ServiceDescriptionFormatExtension.) |
![]() | MapToProperty | Gets or sets a value indicating whether the SoapHeaderBinding instance is mapped to a specific property in generated proxy classes. |
![]() | Message | Gets or sets a value specifying the name of the Message within the XML Web service to which the SoapHeaderBinding applies. |
![]() | Namespace | Get or sets the URI representing the location of the specification for encoding of content not specifically defined by the Encoding property. |
![]() | Parent | Gets the parent of the ServiceDescriptionFormatExtension. (Inherited from ServiceDescriptionFormatExtension.) |
![]() | Part | Gets or sets a value indicating to which MessagePart within the XML Web service the SoapHeaderBinding applies. |
![]() | Required | Gets or sets a value indicating whether the ServiceDescriptionFormatExtension is necessary for the action to which it refers. (Inherited from ServiceDescriptionFormatExtension.) |
![]() | Use | Specifies whether the header is encoded using rules specified by the Encoding property, or is encapsulated within a concrete XML schema. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | 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/.
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'."); } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
