OutputBinding クラス
XML Web サービスで使用する、出力メッセージのデータ形式とプロトコルの仕様のセットを提供します。このクラスは継承できません。
この型のすべてのメンバの一覧については、OutputBinding メンバ を参照してください。
System.Object
System.Web.Services.Description.DocumentableItem
System.Web.Services.Description.MessageBinding
System.Web.Services.Description.OutputBinding
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
スレッドセーフ
この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。
解説
OutputBinding クラスは、 <operation> 要素で囲まれた WSDL (Web Services Description Language) <output> 要素に対応します。さらに、この要素は OperationBinding クラスに対応します。WSDL の詳細については、http://www.w3.org/TR/wsdl/ の仕様を参照してください。
使用例
[Visual Basic, C#, C++] OutputBinding クラスの一般的な使用例を次に示します。
' 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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
名前空間: System.Web.Services.Description
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
アセンブリ: System.Web.Services (System.Web.Services.dll 内)