共用方式為


MessageFault.CreateFault 方法

定義

傳回新的 MessageFault 物件。

多載

CreateFault(Message, Int32)

傳回新的 MessageFault 物件,此物件使用指定的 Message 及訊息緩衝區所指定的緩衝區大小上限。

CreateFault(FaultCode, FaultReason)

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

CreateFault(FaultCode, String)

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

CreateFault(FaultCode, FaultReason, Object)

傳回新的 MessageFault 物件,此物件會使用指定的 FaultCodeFaultReason 和詳細資料物件。

CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer)

傳回新的 MessageFault 物件,這個物件使用指定的 FaultCodeFaultReason、detail 對象和 XmlObjectSerializer 物件。

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

傳回新的 MessageFault 物件,此物件會使用指定的 FaultCodeFaultReason、詳細資料物件、XmlObjectSerializer 和 Actor。

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

傳回新的 MessageFault 物件,此物件會使用指定的 FaultCodeFaultReason、詳細資料物件、XmlObjectSerializer、Actor 和節點值。

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

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

maxBufferSize
Int32

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

傳回

MessageFault物件,含有傳入的參數的初始值。

適用於

CreateFault(FaultCode, FaultReason)

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

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

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

傳回新的 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.cs
來源:
MessageFault.cs
來源:
MessageFault.cs

傳回新的 MessageFault 物件,此物件會使用指定的 FaultCodeFaultReason 和詳細資料物件。

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

傳回新的 MessageFault 物件,此物件會使用指定的 FaultCodeFaultReason、詳細資料物件、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, 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

Actor 的值。

傳回

MessageFault物件,含有傳入的參數的初始值。

適用於

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

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

傳回新的 MessageFault 物件,此物件會使用指定的 FaultCodeFaultReason、詳細資料物件、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, 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

Actor 的值。

node
String

節點的值。

傳回

MessageFault物件,含有傳入的參數的初始值。

適用於