ClientRuntime.ValidateMustUnderstand 屬性

定義

取得或設定值,這個值會指定系統或應用程式是否會強制執行 SOAP MustUnderstand 標頭處理。

public:
 property bool ValidateMustUnderstand { bool get(); void set(bool value); };
public bool ValidateMustUnderstand { get; set; }
member this.ValidateMustUnderstand : bool with get, set
Public Property ValidateMustUnderstand As Boolean

屬性值

Boolean

如果系統要執行 SOAP 標頭 true 處理,則為 MustUnderstand,否則為 false,表示應用程式會執行這項處理。 預設值是 true

備註

使用 ValidateMustUnderstand 屬性,即可關閉對抵達之訊息標頭的強制驗證。 在正常的執行過程中,訊息標頭會與 UnderstoodHeaders 屬性進行比較,以確認服務已明確地處理抵達的標頭。 將此屬性設定為 false,即可停用這項檢查。 如果是設定為 false,應用程式就必須檢查標示為 MustUnderstand="true" 的標頭,並在無法瞭解其中一或多個標頭時傳回錯誤。 當應用程式應該接受任何傳回的 SOAP 訊息 (例如,使用具型別或不具型別的訊息時) 以及執行自訂標頭處理時,這種設定會十分有用。

適用於