共用方式為


MessageFault.CreateFault 方法

定義

傳回新的 MessageFault 物件。

多載

CreateFault(Message, Int32)

傳回新的 MessageFault 物件,該物件會使用指定的 Message 和訊息緩衝區的指定緩衝區大小上限。

CreateFault(FaultCode, FaultReason)

傳回使用指定 FaultCodeFaultReason 物件的新 MessageFault 物件。

CreateFault(FaultCode, String)

傳回使用指定 FaultCode 和錯誤原因的新 MessageFault 物件。

CreateFault(FaultCode, FaultReason, Object)

傳回新的 MessageFault 物件,該物件使用指定的 FaultCodeFaultReason和 detail 物件。

CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer)

傳回新的 MessageFault 物件,該物件使用指定的 FaultCodeFaultReason、detail 物件和 XmlObjectSerializer 物件。

CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String)

傳回使用指定 FaultCodeFaultReason、詳細數據物件、XmlObjectSerializer和動作專案的新 MessageFault 物件。

CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String, String)

傳回新的 MessageFault 物件,該物件使用指定的 FaultCodeFaultReason、詳細數據物件、XmlObjectSerializer、動作專案和節點值。

CreateFault(Message, Int32)

來源:
MessageFault.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回新的 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

要用來建立 MessageFault 物件的指定 Message

maxBufferSize
Int32

訊息緩衝區的指定緩衝區大小上限。

傳回

具有傳入參數之初始值的 MessageFault 物件。

適用於

CreateFault(FaultCode, FaultReason)

來源:
MessageFault.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回使用指定 FaultCodeFaultReason 物件的新 MessageFault 物件。

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.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回使用指定 FaultCode 和錯誤原因的新 MessageFault 物件。

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.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回新的 MessageFault 物件,該物件使用指定的 FaultCodeFaultReason和 detail 物件。

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.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回新的 MessageFault 物件,該物件使用指定的 FaultCodeFaultReason、detail 物件和 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, object detail, System.Runtime.Serialization.XmlObjectSerializer serializer);
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

參數

code
FaultCode

錯誤訊息的錯誤碼。

reason
FaultReason

錯誤的原因。

detail
Object

錯誤詳細資料物件。

serializer
XmlObjectSerializer

串行化詳細數據物件時要使用的串行化程式。

傳回

具有傳入參數之初始值的 MessageFault 物件。

適用於

CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String)

來源:
MessageFault.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回使用指定 FaultCodeFaultReason、詳細數據物件、XmlObjectSerializer和動作專案的新 MessageFault 物件。

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, object detail, System.Runtime.Serialization.XmlObjectSerializer serializer, string actor);
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

參數

code
FaultCode

錯誤訊息的錯誤碼。

reason
FaultReason

錯誤的原因。

detail
Object

錯誤詳細資料物件。

serializer
XmlObjectSerializer

串行化詳細數據物件時要使用的串行化程式。

actor
String

動作專案的值。

傳回

具有傳入參數之初始值的 MessageFault 物件。

適用於

CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String, String)

來源:
MessageFault.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回新的 MessageFault 物件,該物件使用指定的 FaultCodeFaultReason、詳細數據物件、XmlObjectSerializer、動作專案和節點值。

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, object detail, System.Runtime.Serialization.XmlObjectSerializer serializer, string actor, string node);
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

參數

code
FaultCode

錯誤訊息的錯誤碼。

reason
FaultReason

錯誤的原因。

detail
Object

錯誤詳細資料物件。

serializer
XmlObjectSerializer

串行化詳細數據物件時要使用的串行化程式。

actor
String

動作專案的值。

node
String

節點的值。

傳回

具有傳入參數之初始值的 MessageFault 物件。

適用於