Export (0) Print
Expand All

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)

public class SoapHeaderBinding extends ServiceDescriptionFormatExtension

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/.

No code example is currently available or this language may not be supported.
#using <mscorlib.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Web::Services::Description;
using namespace System::Collections;
using namespace System::Xml;

int main() 
{
   ServiceDescription* myServiceDescription =
      ServiceDescription::Read(S"SoapHeaderBindingInput_cpp.wsdl");
   Binding* myBinding = new Binding();
   myBinding->Name = S"MyWebServiceSoap";
   myBinding->Type = new XmlQualifiedName(S"s0:MyWebServiceSoap");

   SoapBinding* mySoapBinding = new SoapBinding();
   mySoapBinding->Transport=S"http://schemas.xmlsoap.org/soap/http";
   mySoapBinding->Style=SoapBindingStyle::Document;
   myBinding->Extensions->Add(mySoapBinding);

   OperationBinding* myOperationBinding = new OperationBinding();
   myOperationBinding->Name = S"Hello";

   SoapOperationBinding* mySoapOperationBinding = new SoapOperationBinding();
   mySoapOperationBinding->SoapAction = S"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(S"s0:HelloMyHeader");
   mySoapHeaderBinding->Part=S"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(S"SoapHeaderBindingOut_cpp.wsdl");
   Console::WriteLine(S"'SoapHeaderBindingOut_cpp.wsdl' file is generated.");
   Console::WriteLine(S"Proxy could be created using 'wsdl SoapHeaderBindingOut_cpp.wsdl'.");
}

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft