This documentation is archived and is not being maintained.

SoapHeaderBinding.Part Property

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

[Visual Basic]
Public Property Part As String
[C#]
public string Part {get; set;}
[C++]
public: __property String* get_Part();
public: __property void set_Part(String*);
[JScript]
public function get Part() : String;
public function set Part(String);

Property Value

A string representing the Name of the MessagePart to which the SoapHeaderBinding applies.

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: