共用方式為


SoapHeader.Role 屬性

定義

取得或設定 SOAP 標頭的接收者。

public:
 property System::String ^ Role { System::String ^ get(); void set(System::String ^ value); };
[System.Runtime.InteropServices.ComVisible(false)]
public string Role { get; set; }
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.Role : string with get, set
Public Property Role As String

屬性值

一個代表 SOAP 標頭接收者的 URI。 預設為空字串(“”)。

屬性

備註

要設定 SOAP 標頭的接收者,請設定屬性 Actor 。 無論用來與 XML Web 服務通訊的 SOAP 協定版本為何,.NET Framework 都會自動產生與該 SOAP 協定版本相關的 SOAP 訊息。 具體來說,兩個版本的 XML 元素與代表接收者的 XML 命名空間有所不同。

接收 SOAP 標頭的 XML 網路服務可透過取得 RoleActor 屬性來取得預期收件人。

該元素的接收者 Body 與 SOAP 訊息中元素內 Header 的每個 SOAP 標頭不必相同。 若 Header SOAP 訊息中存在元素,代表可與 XML Web 服務方法或中介機構傳送的額外資料。 這些資料的接收者,在 SOAP 規範 1.2 版本中稱為 SOAP,在 1.1 版本中稱為 SOAP RoleActor ,可以是與 XML Web 服務方法的 URI 不同的 URI。

欲了解更多 SOAP actor 屬性的資訊,請參閱 SOAP 規範。

適用於