共用方式為


OutputBinding 類別

定義

提供由 XML Web Service 用於輸出訊息的資料格式和通訊協定的規格集。 此類別無法獲得繼承。

public ref class OutputBinding sealed : System::Web::Services::Description::MessageBinding
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class OutputBinding : System.Web.Services.Description.MessageBinding
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type OutputBinding = class
    inherit MessageBinding
Public NotInheritable Class OutputBinding
Inherits MessageBinding
繼承
繼承
屬性

範例

下列範例示範 類別的 OutputBinding 一般用法。

// Used to create OperationBinding instances within 'Binding'.
static OperationBinding^ CreateOperationBinding( String^ operation, String^ targetNamespace )
{
   // Create OperationBinding for operation.
   OperationBinding^ myOperationBinding = gcnew OperationBinding;
   myOperationBinding->Name = operation;

   // Create InputBinding for operation.
   InputBinding^ myInputBinding = gcnew InputBinding;
   SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding;
   mySoapBodyBinding->Use = SoapBindingUse::Literal;
   myInputBinding->Extensions->Add( mySoapBodyBinding );

   // Create OutputBinding for operation.
   OutputBinding^ myOutputBinding = gcnew 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 = gcnew SoapOperationBinding;
   mySoapOperationBinding->Style = SoapBindingStyle::Document;
   mySoapOperationBinding->SoapAction = String::Concat( targetNamespace, operation );

   // Add the extensibility element SoapOperationBinding to OperationBinding.
   myOperationBinding->Extensions->Add( mySoapOperationBinding );
   return myOperationBinding;
}
// 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;
}
' 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

備註

類別 OutputBinding 會對應至元素所括住 <operation> 的 Web 服務描述語言 (WSDL) <output> 元素,而該專案接著會對應至 OperationBinding 類別。 如需 WSDL 的詳細資訊,請參閱 WSDL 規格。

建構函式

OutputBinding()

初始化 OutputBinding 類別的新執行個體。

屬性

Documentation

取得或設定 DocumentableItem 的執行個體的文字文件。

(繼承來源 DocumentableItem)
DocumentationElement

取得或設定 DocumentableItem 的文件項目。

(繼承來源 DocumentableItem)
ExtensibleAttributes

取得或設定型別 XmlAttribute 的陣列,表示符合 Web 服務互通性 (WS-I) Basic Profile 1.1 的 WSDL 屬性擴充。

(繼承來源 DocumentableItem)
Extensions

取得與目前 OutputBinding 相關的擴充性項目的集合。

Name

取得或設定 MessageBinding 的名稱。

(繼承來源 MessageBinding)
Namespaces

取得或設定命名空間前置詞和命名空間的字典,用於在建構 ServiceDescription 物件時保留命名空間前置詞和命名空間。

(繼承來源 DocumentableItem)
OperationBinding

取得 OperationBinding,目前 MessageBinding 為其中的成員。

(繼承來源 MessageBinding)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於