FaultConverter.TryCreateException(Message, MessageFault, Exception) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
public:
bool TryCreateException(System::ServiceModel::Channels::Message ^ message, System::ServiceModel::Channels::MessageFault ^ fault, [Runtime::InteropServices::Out] Exception ^ % exception);
public bool TryCreateException(System.ServiceModel.Channels.Message message, System.ServiceModel.Channels.MessageFault fault, out Exception exception);
member this.TryCreateException : System.ServiceModel.Channels.Message * System.ServiceModel.Channels.MessageFault * Exception -> bool
Public Function TryCreateException (message As Message, fault As MessageFault, ByRef exception As Exception) As Boolean
參數
- message
- Message
故障訊息。
- fault
- MessageFault
錯誤。
- exception
- Exception
若轉換成功,SOAP 例外會以參數形式回傳 out 。
傳回
true若過錯成功轉換;否則,。 false 預設值為 false。
例外狀況
message 或 fault 為 null。
-或-
OnTryCreateException(Message, MessageFault, Exception) 已退回 true ,但 exception 實際上是 null。
-或-
OnTryCreateException(Message, MessageFault, Exception) 返回 false 但 exception 並非 null。
備註
OnTryCreateException 是一個你必須實作的抽象類別。 目前的方法會圍繞呼叫該方法進行多個參數錯誤測試。