Export (0) Print
Expand All

OutputBinding Class

Provides a set of specifications for data formats and protocols used by the XML Web service for output messages. This class cannot be inherited.

For a list of all members of this type, see OutputBinding Members.

System.Object
   System.Web.Services.Description.DocumentableItem
      System.Web.Services.Description.MessageBinding
         System.Web.Services.Description.OutputBinding

[Visual Basic]
NotInheritable Public Class OutputBinding
   Inherits MessageBinding
[C#]
public sealed class OutputBinding : MessageBinding
[C++]
public __gc __sealed class OutputBinding : public MessageBinding
[JScript]
public class OutputBinding extends MessageBinding

Thread Safety

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

Remarks

The OutputBinding class corresponds to the Web Services Description Language (WSDL) <output> element enclosed by the <operation> element, which in turn corresponds to the OperationBinding class. For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.

Example

[Visual Basic, C#, C++] The following example demonstrates a typical use of the OutputBinding class.

[Visual Basic] 
' Used to create OperationBinding instances within 'Binding'.
Public Shared Function CreateOperationBinding(operation As String, _
   targetNamespace As String) As OperationBinding

   ' Create OperationBinding for operation.
   Dim myOperationBinding As New OperationBinding()
   myOperationBinding.Name = operation

   ' Create InputBinding for operation.
   Dim myInputBinding As New InputBinding()
   Dim mySoapBodyBinding As New SoapBodyBinding()
   mySoapBodyBinding.Use = SoapBindingUse.Literal
   myInputBinding.Extensions.Add(mySoapBodyBinding)
   ' Create OutputBinding for operation.
   Dim myOutputBinding As New OutputBinding()
   myOutputBinding.Extensions.Add(mySoapBodyBinding)

   ' Add InputBinding and OutputBinding to OperationBinding. 
   myOperationBinding.Input = myInputBinding
   myOperationBinding.Output = myOutputBinding

   ' Create an extensibility element for SoapOperationBinding.
   Dim mySoapOperationBinding As New SoapOperationBinding()
   mySoapOperationBinding.Style = SoapBindingStyle.Document
   mySoapOperationBinding.SoapAction = targetNamespace & operation

   ' Add the extensibility element SoapOperationBinding to OperationBinding.
   myOperationBinding.Extensions.Add(mySoapOperationBinding)
   Return myOperationBinding
End Function 'CreateOperationBinding


[C#] 
// Used to create OperationBinding instances within 'Binding'.
public static OperationBinding CreateOperationBinding(string operation,
   string targetNamespace)
{
   // Create OperationBinding for operation.
   OperationBinding myOperationBinding = new OperationBinding();
   myOperationBinding.Name = operation;
   // Create InputBinding for operation.
   InputBinding myInputBinding = new InputBinding();
   SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding();
   mySoapBodyBinding.Use = SoapBindingUse.Literal;
   myInputBinding.Extensions.Add(mySoapBodyBinding);
   // Create OutputBinding for operation.
   OutputBinding myOutputBinding = new OutputBinding();
   myOutputBinding.Extensions.Add(mySoapBodyBinding);

   // Add InputBinding and OutputBinding to OperationBinding.
   myOperationBinding.Input = myInputBinding;
   myOperationBinding.Output = myOutputBinding;

   // Create an extensibility element for SoapOperationBinding.
   SoapOperationBinding mySoapOperationBinding = new SoapOperationBinding();
   mySoapOperationBinding.Style = SoapBindingStyle.Document;
   mySoapOperationBinding.SoapAction = targetNamespace + operation;

   // Add the extensibility element SoapOperationBinding to OperationBinding.
   myOperationBinding.Extensions.Add(mySoapOperationBinding);
   return myOperationBinding;
}

[C++] 
// Used to create OperationBinding instances within 'Binding'.
public:
static OperationBinding* CreateOperationBinding(String* operation,
   String* targetNamespace)
{
   // Create OperationBinding for operation.
   OperationBinding* myOperationBinding = new OperationBinding();
   myOperationBinding->Name = operation;
   // Create InputBinding for operation.
   InputBinding* myInputBinding = new InputBinding();
   SoapBodyBinding* mySoapBodyBinding = new SoapBodyBinding();
   mySoapBodyBinding->Use = SoapBindingUse::Literal;
   myInputBinding->Extensions->Add(mySoapBodyBinding);
   // Create OutputBinding for operation.
   OutputBinding* myOutputBinding = new OutputBinding();
   myOutputBinding->Extensions->Add(mySoapBodyBinding);

   // Add InputBinding and OutputBinding to OperationBinding.
   myOperationBinding->Input = myInputBinding;
   myOperationBinding->Output = myOutputBinding;

   // Create an extensibility element for SoapOperationBinding.
   SoapOperationBinding* mySoapOperationBinding = new SoapOperationBinding();
   mySoapOperationBinding->Style = SoapBindingStyle::Document;
   mySoapOperationBinding->SoapAction = String::Concat(targetNamespace, operation);

   // Add the extensibility element SoapOperationBinding to OperationBinding.
   myOperationBinding->Extensions->Add(mySoapOperationBinding);
   return myOperationBinding;
}

[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

Namespace: System.Web.Services.Description

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

Assembly: System.Web.Services (in System.Web.Services.dll)

See Also

OutputBinding Members | System.Web.Services.Description Namespace

Show:
© 2014 Microsoft