MessageFault.CreateFault 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回新的 MessageFault 物件。
多載
CreateFault(Message, Int32) |
傳回新的 MessageFault 物件,此物件使用指定的 Message 及訊息緩衝區所指定的緩衝區大小上限。 |
CreateFault(FaultCode, FaultReason) |
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode 和 FaultReason 物件。 |
CreateFault(FaultCode, String) |
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode 和錯誤原因。 |
CreateFault(FaultCode, FaultReason, Object) |
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason 和詳細資料物件。 |
CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer) |
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason、詳細資料物件和 XmlObjectSerializer 物件。 |
CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String) |
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason、詳細資料物件、XmlObjectSerializer 和 Actor。 |
CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String, String) |
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason、詳細資料物件、XmlObjectSerializer、Actor 和節點值。 |
CreateFault(Message, Int32)
傳回新的 MessageFault 物件,此物件使用指定的 Message 及訊息緩衝區所指定的緩衝區大小上限。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::Channels::Message ^ message, int maxBufferSize);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.Channels.Message message, int maxBufferSize);
static member CreateFault : System.ServiceModel.Channels.Message * int -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (message As Message, maxBufferSize As Integer) As MessageFault
參數
- message
- Message
用來建立 Message 物件所指定的 MessageFault。
- maxBufferSize
- Int32
訊息緩衝區的指定緩衝區大小上限。
傳回
MessageFault物件,含有傳入的參數的初始值。
適用於
CreateFault(FaultCode, FaultReason)
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode 和 FaultReason 物件。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason);
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason) As MessageFault
參數
- code
- FaultCode
錯誤訊息的錯誤碼。
- reason
- FaultReason
錯誤的原因。
傳回
MessageFault物件,含有傳入的參數的初始值。
適用於
CreateFault(FaultCode, String)
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode 和錯誤原因。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::String ^ reason);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, string reason);
static member CreateFault : System.ServiceModel.FaultCode * string -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As String) As MessageFault
參數
- code
- FaultCode
錯誤訊息的錯誤碼。
- reason
- String
錯誤的原因。
傳回
MessageFault物件,含有傳入的參數的初始值。
適用於
CreateFault(FaultCode, FaultReason, Object)
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason 和詳細資料物件。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail);
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object) As MessageFault
參數
- code
- FaultCode
錯誤訊息的錯誤碼。
- reason
- FaultReason
錯誤的原因。
- detail
- Object
錯誤詳細資料物件。
傳回
MessageFault物件,含有傳入的參數的初始值。
適用於
CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer)
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason、詳細資料物件和 XmlObjectSerializer 物件。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail, System::Runtime::Serialization::XmlObjectSerializer ^ serializer);
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail, System::Runtime::Serialization::XmlObjectSerializer ^ formatter);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail, System.Runtime.Serialization.XmlObjectSerializer serializer);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail, System.Runtime.Serialization.XmlObjectSerializer formatter);
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj * System.Runtime.Serialization.XmlObjectSerializer -> System.ServiceModel.Channels.MessageFault
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj * System.Runtime.Serialization.XmlObjectSerializer -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object, serializer As XmlObjectSerializer) As MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object, formatter As XmlObjectSerializer) As MessageFault
參數
- code
- FaultCode
錯誤訊息的錯誤碼。
- reason
- FaultReason
錯誤的原因。
- detail
- Object
錯誤詳細資料物件。
- serializerformatter
- XmlObjectSerializer
在序列化詳細資料物件時所要使用的序列化程式。
傳回
MessageFault物件,含有傳入的參數的初始值。
適用於
CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String)
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason、詳細資料物件、XmlObjectSerializer 和 Actor。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail, System::Runtime::Serialization::XmlObjectSerializer ^ serializer, System::String ^ actor);
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail, System::Runtime::Serialization::XmlObjectSerializer ^ formatter, System::String ^ actor);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail, System.Runtime.Serialization.XmlObjectSerializer serializer, string actor);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail, System.Runtime.Serialization.XmlObjectSerializer formatter, string actor);
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj * System.Runtime.Serialization.XmlObjectSerializer * string -> System.ServiceModel.Channels.MessageFault
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj * System.Runtime.Serialization.XmlObjectSerializer * string -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object, serializer As XmlObjectSerializer, actor As String) As MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object, formatter As XmlObjectSerializer, actor As String) As MessageFault
參數
- code
- FaultCode
錯誤訊息的錯誤碼。
- reason
- FaultReason
錯誤的原因。
- detail
- Object
錯誤詳細資料物件。
- serializerformatter
- XmlObjectSerializer
在序列化詳細資料物件時所要使用的序列化程式。
- actor
- String
Actor 的值。
傳回
MessageFault物件,含有傳入的參數的初始值。
適用於
CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String, String)
傳回新的 MessageFault 物件,此物件會使用指定的 FaultCode、FaultReason、詳細資料物件、XmlObjectSerializer、Actor 和節點值。
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail, System::Runtime::Serialization::XmlObjectSerializer ^ serializer, System::String ^ actor, System::String ^ node);
public:
static System::ServiceModel::Channels::MessageFault ^ CreateFault(System::ServiceModel::FaultCode ^ code, System::ServiceModel::FaultReason ^ reason, System::Object ^ detail, System::Runtime::Serialization::XmlObjectSerializer ^ formatter, System::String ^ actor, System::String ^ node);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail, System.Runtime.Serialization.XmlObjectSerializer serializer, string actor, string node);
public static System.ServiceModel.Channels.MessageFault CreateFault (System.ServiceModel.FaultCode code, System.ServiceModel.FaultReason reason, object detail, System.Runtime.Serialization.XmlObjectSerializer formatter, string actor, string node);
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj * System.Runtime.Serialization.XmlObjectSerializer * string * string -> System.ServiceModel.Channels.MessageFault
static member CreateFault : System.ServiceModel.FaultCode * System.ServiceModel.FaultReason * obj * System.Runtime.Serialization.XmlObjectSerializer * string * string -> System.ServiceModel.Channels.MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object, serializer As XmlObjectSerializer, actor As String, node As String) As MessageFault
Public Shared Function CreateFault (code As FaultCode, reason As FaultReason, detail As Object, formatter As XmlObjectSerializer, actor As String, node As String) As MessageFault
參數
- code
- FaultCode
錯誤訊息的錯誤碼。
- reason
- FaultReason
錯誤的原因。
- detail
- Object
錯誤詳細資料物件。
- serializerformatter
- XmlObjectSerializer
在序列化詳細資料物件時所要使用的序列化程式。
- actor
- String
Actor 的值。
- node
- String
節點的值。
傳回
MessageFault物件,含有傳入的參數的初始值。