SoapHeader.Actor プロパティ
アセンブリ: System.Web.Services (system.web.services.dll 内)

SOAP ヘッダーの受信者。既定値は空の文字列 ("") です。

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 サービス メソッドに渡したり、XML Web サービス メソッドから返されたり、またはその中間物に渡したり、中間物から返される追加データを表します。Version 1.1 の SOAP Actor と呼ばれるこのデータの受信者は、XML Web サービス メソッドの URI と同一の URI である必要はありません。
SOAP actor 属性の詳細については、SOAP の仕様 (http://www.w3.org/TR/SOAP/) を参照してください。

XML Web サービス クライアントが、MyHeader 型のカスタム SOAP ヘッダーを作成し、Actor プロパティを http://www.contoso.com/MySoapHeaderHandler に設定した後で、MyWebMethod XML Web サービス メソッドを呼び出す例を次に示します。
Imports System 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
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()); } } }
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 ); } }
import System.*; public class Sample { public static void main(String[] args) { MyWebService ws = new MyWebService(); try { MyHeader customHeader = new MyHeader(); customHeader.myValue = "Header Value for MyValue"; customHeader.set_Actor( "http://www.contoso.com/MySoapHeaderHandler"); ws.myHeader = customHeader; int results = ws.MyWebMethod(3, 5); } catch (System.Exception e) { Console.WriteLine("Exception: {0}", e.ToString()); } } //main } //Sample

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSoapHeader.Actor プロパティを検索する場合は、下記のリンクをクリックしてください。

- SoapHeader.Actor プロパティのページへのリンク