SoapHeader.Actor プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
SOAP ヘッダーの受信者を取得または設定します。
public:
property System::String ^ Actor { System::String ^ get(); void set(System::String ^ value); };
public string Actor { get; set; }
member this.Actor : string with get, set
Public Property Actor As String
プロパティ値
SOAP ヘッダーの受信者。 既定値は空の文字列 ("") です。
例
次の XML Web サービス クライアントは、MyHeader型のカスタム SOAP ヘッダーを作成し、Actor プロパティを http://www.contoso.com/MySoapHeaderHandler に設定した後、MyWebMethod XML Web サービス メソッドを呼び出します。
int main()
{
MyWebService^ ws = gcnew MyWebService;
try
{
MyHeader^ customHeader = gcnew MyHeader;
customHeader->MyValue = "Header Value for MyValue";
customHeader->Actor = "http://www.contoso.com/MySoapHeaderHandler";
ws->myHeader = customHeader;
int results = ws->MyWebMethod( 3, 5 );
}
catch ( Exception^ e )
{
Console::WriteLine( "Exception: {0}", e );
}
}
using System;
public class Sample {
public static void Main() {
MyWebService ws = new MyWebService();
try {
MyHeader customHeader = new MyHeader();
customHeader.MyValue = "Header Value for MyValue";
customHeader.Actor = "http://www.contoso.com/MySoapHeaderHandler";
ws.myHeader = customHeader;
int results = ws.MyWebMethod(3,5);
}
catch (Exception e) {
Console.WriteLine ("Exception: {0}", e.ToString());
}
}
}
Public Class Sample
Public Shared Sub Main()
Dim ws As New MyWebService()
Try
Dim customHeader As New MyHeader1()
customHeader.MyValue = "Header Value for MyValue"
customHeader.Actor = "http://www.contoso.com/MySoapHeaderHandler"
ws.myHeader = customHeader
Dim results As Integer
results = ws.MyWebMethod(3,5)
Catch e As Exception
Console.WriteLine("Exception: {0}", e.ToString())
End Try
End Sub
End Class
注釈
SOAP ヘッダーの受信者を設定するには、 Actor プロパティを設定します。 XML Web サービスとの通信に使用される SOAP プロトコルのバージョンに関係なく、.NET Framework は SOAP プロトコルのバージョンに固有の SOAP メッセージを自動的に生成します。 具体的には、受信者を表す XML 要素と XML 名前空間は、2 つのバージョンで異なります。
SOAP ヘッダーを受信する XML Web サービスは、 Role プロパティまたは Actor プロパティを取得することで、目的の受信者を取得できます。
Body要素の受信者と、SOAP メッセージのHeader要素内の各 SOAP ヘッダーは同じである必要はありません。 SOAP メッセージに Header 要素が存在する場合は、XML Web サービス メソッドまたは中継局との間で送受信できる追加のデータを表します。 そのデータの受信者 (バージョン 1.1 の SOAP Actor と呼ばれます) は、XML Web サービス メソッドの URI とは異なる URI にすることができます。
SOAP actor 属性の詳細については、 SOAP の仕様を参照してください。