SoapHeaderCollection Class
.NET Framework 3.0
Contains a collection of instances of the SoapHeader class.
Namespace: System.Web.Services.Protocols
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
[System::Web::Services::WebServiceBindingAttribute(Name="MathSvcSoap", Namespace="http://tempuri.org/")] public ref class MathSvc: public System::Web::Services::Protocols::SoapHttpClientProtocol { public: array<SoapHeader^>^ mySoapHeaders; [SoapHeaderAttribute("mySoapHeaders", Direction=SoapHeaderDirection::In)] [System::Web::Services::Protocols::SoapDocumentMethodAttribute( "http://tempuri.org/Add", Use=System::Web::Services::Description::SoapBindingUse::Literal, ParameterStyle=System::Web::Services::Protocols::SoapParameterStyle::Wrapped)] [MySoapExtensionAttribute] Single Add( Single xValue, Single yValue ) { SoapHeaderCollection^ mySoapHeaderCollection = gcnew SoapHeaderCollection; MySoapHeader^ mySoapHeader; mySoapHeader = gcnew MySoapHeader; mySoapHeader->text = "This is the first SOAP header"; mySoapHeaderCollection->Add( mySoapHeader ); mySoapHeader = gcnew MySoapHeader; mySoapHeader->text = "This is the second SOAP header"; mySoapHeaderCollection->Add( mySoapHeader ); mySoapHeader = gcnew MySoapHeader; mySoapHeader->text = "This header is inserted before the first header"; mySoapHeaderCollection->Insert( 0, mySoapHeader ); mySoapHeaders = gcnew array<MySoapHeader^>(mySoapHeaderCollection->Count); mySoapHeaderCollection->CopyTo( mySoapHeaders, 0 ); array<Object^>^ temp0 = {xValue,yValue}; array<Object^>^ results = this->Invoke( "Add", temp0 ); return ( (Single)( results[ 0 ] ) ); } [System::Diagnostics::DebuggerStepThroughAttribute] MathSvc() { this->Url = "http://localhost/MathSvc_SoapHeaderCollection.cs.asmx"; } System::IAsyncResult^ BeginAdd( Single xValue, Single yValue, System::AsyncCallback^ callback, Object^ asyncState ) { array<Object^>^ temp1 = {xValue,yValue}; return this->BeginInvoke( "Add", temp1, callback, asyncState ); } Single EndAdd( System::IAsyncResult^ asyncResult ) { array<Object^>^ results = this->EndInvoke( asyncResult ); return ( (Single)( results[ 0 ] ) ); } };
/** @attribute System.Web.Services.WebServiceBindingAttribute(
Name = "MathSvcSoap", Namespace = "http://tempuri.org/")
*/
public class MathSvc extends System.Web.Services.Protocols.
SoapHttpClientProtocol
{
public SoapHeader mySoapHeaders[];
/** @attribute SoapHeaderAttribute("mySoapHeaders",
Direction = SoapHeaderDirection.In)
*/
/** @attribute System.Web.Services.Protocols.SoapDocumentMethodAttribute(
"http://tempuri.org/Add", Use = System.Web.Services.Description.
SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols. SoapParameterStyle.Wrapped)
*/
/** @attribute MySoapExtensionAttribute()
*/
public float Add(float xValue, float yValue)
{
SoapHeaderCollection mySoapHeaderCollection
= new SoapHeaderCollection();
MySoapHeader mySoapHeader;
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This is the first SOAP header";
mySoapHeaderCollection.Add(mySoapHeader);
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This is the second SOAP header";
mySoapHeaderCollection.Add(mySoapHeader);
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This header is inserted before the first header";
mySoapHeaderCollection.Insert(0, mySoapHeader);
mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.get_Count()];
mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
Object results[] = this.Invoke("Add", new Object[] {
(System.Double)xValue, (System.Double)yValue });
return (float)(System.Double)results.get_Item(0);
} //Add
/** @attribute System.Diagnostics.DebuggerStepThroughAttribute()
*/
public MathSvc()
{
this.set_Url("http://localhost/MathSvc_SoapHeaderCollection.jsl.asmx");
} //MathSvc
public System.IAsyncResult BeginAdd(float xValue, float yValue,
System.AsyncCallback callBack, Object asyncState)
{
return this.BeginInvoke("Add", new Object[] {
(System.Double)xValue, (System.Double)yValue }, callBack,
asyncState);
} //BeginAdd
public float EndAdd(System.IAsyncResult asyncResult)
{
Object results[] = this.EndInvoke(asyncResult);
return (float)(System.Double)results.get_Item(0);
} //EndAdd
} //MathSvc
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: