This documentation is archived and is not being maintained.

SoapHeaderBinding.Use Property

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

[Visual Basic]
Public Property Use As SoapBindingUse
[C#]
public SoapBindingUse Use {get; set;}
[C++]
public: __property SoapBindingUse get_Use();
public: __property void set_Use(SoapBindingUse);
[JScript]
public function get Use() : SoapBindingUse;
public function set Use(SoapBindingUse);

Property Value

One of the SoapBindingUse values. The default is Default.

Example

[Visual Basic] 
Dim mySoapHeaderBinding As New SoapHeaderBinding()
' Set the Message within the XML Web service to which the 
' 'SoapHeaderBinding' applies.
mySoapHeaderBinding.Message = New XmlQualifiedName("s0:HelloMyHeader")
mySoapHeaderBinding.Part = "MyHeader"
mySoapHeaderBinding.Use = SoapBindingUse.Literal
' Add mySoapHeaderBinding to the 'myInputBinding' object.
myInputBinding.Extensions.Add(mySoapHeaderBinding)

[C#] 
SoapHeaderBinding mySoapHeaderBinding=new SoapHeaderBinding();
// Set the Message within the XML Web service to which the 
// 'SoapHeaderBinding' applies.
mySoapHeaderBinding.Message=
               new XmlQualifiedName("s0:HelloMyHeader");
mySoapHeaderBinding.Part="MyHeader";
mySoapHeaderBinding.Use=SoapBindingUse.Literal;
// Add mySoapHeaderBinding to the 'myInputBinding' object. 
myInputBinding.Extensions.Add(mySoapHeaderBinding);

[C++] 
SoapHeaderBinding* mySoapHeaderBinding = new SoapHeaderBinding();
// Set the Message within the XML Web service to which the
// 'SoapHeaderBinding' applies.
mySoapHeaderBinding->Message = new XmlQualifiedName(S"s0:HelloMyHeader");
mySoapHeaderBinding->Part=S"MyHeader";
mySoapHeaderBinding->Use=SoapBindingUse::Literal;
// Add mySoapHeaderBinding to the 'myInputBinding' object.
myInputBinding->Extensions->Add(mySoapHeaderBinding);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SoapHeaderBinding Class | SoapHeaderBinding Members | System.Web.Services.Description Namespace

Show: