共用方式為


ServiceHostBase.UnknownMessageReceived 事件

定義

發生於收到未知訊息時。

public:
 event EventHandler<System::ServiceModel::UnknownMessageReceivedEventArgs ^> ^ UnknownMessageReceived;
public event EventHandler<System.ServiceModel.UnknownMessageReceivedEventArgs> UnknownMessageReceived;
member this.UnknownMessageReceived : EventHandler<System.ServiceModel.UnknownMessageReceivedEventArgs> 
Public Custom Event UnknownMessageReceived As EventHandler(Of UnknownMessageReceivedEventArgs) 
Public Event UnknownMessageReceived As EventHandler(Of UnknownMessageReceivedEventArgs) 

事件類型

備註

警告

使用 WorkflowServiceHost 時,會公開裝載端點,並 UnknownMessageReceived 擲回例外狀況,主機會將訊息傳遞至事件處理常式。 如果嘗試讀取此訊息, InvalidOperationException 則會擲回 。 例外狀況的描述會指出「此訊息無法支援作業,因為它已讀取。」WCF 基礎結構會在擷取訊息參數時讀取訊息。 此訊息接著會傳遞至事件處理常式,而且任何嘗試讀取它都會造成例外狀況。 如果您需要從裝載端點存取處理常式中的 InvalidOperationException 訊息參數,請使用 MessageContract 定義裝載端點合約,並將所需的資料放入訊息標頭中。 如需裝載端點的詳細資訊,請參閱 工作流程服務主機擴充性

適用於