Rediger

Del via


ReceiveActivity.FaultMessage Property

Definition

The exception that is returned when a receive activity completes execution.

public:
 property System::ServiceModel::FaultException ^ FaultMessage { System::ServiceModel::FaultException ^ get(); void set(System::ServiceModel::FaultException ^ value); };
[System.ComponentModel.Browsable(true)]
public System.ServiceModel.FaultException FaultMessage { get; set; }
[<System.ComponentModel.Browsable(true)>]
member this.FaultMessage : System.ServiceModel.FaultException with get, set
Public Property FaultMessage As FaultException

Property Value

A FaultException object that contains the fault message text and details.

Attributes

Examples

The following code sample shows how to access the FaultMessage property.

ReceiveActivity receiveQuote;
receiveQuote = new ReceiveActivity();

FaultException message = receiveQuote.FaultMessage;

Remarks

If the FaultMessage property is set to an instance of type FaultException, the fault is returned to the client upon completion.

If an exception is thrown during the activity execution and the FaultMessage property is set, then the specified fault is returned to the client. If an exception is thrown during the activity execution and the FaultMessage property is set, and the associated operation has a FaultContractAttribute attribute that specifies a fault type that matches that of the FaultMessage property, then the channel is not faulted and the client can still communicate to the server. If the FaultMessage property is not set, the thrown exception is returned as a fault to the client.

Applies to