Editare

Partajați prin


CallbackDebugBehavior Class

Definition

Enables service debugging for a Windows Communication Foundation (WCF) callback object.

public ref class CallbackDebugBehavior : System::ServiceModel::Description::IEndpointBehavior
public class CallbackDebugBehavior : System.ServiceModel.Description.IEndpointBehavior
type CallbackDebugBehavior = class
    interface IEndpointBehavior
Public Class CallbackDebugBehavior
Implements IEndpointBehavior
Inheritance
CallbackDebugBehavior
Implements

Examples

The following code example shows a client configuration file that instructs WCF to return managed exception information from a client callback object in SOAP messages.

  <client>
      <endpoint 
        address="http://localhost:8080/DuplexHello" 
        binding="wsDualHttpBinding"
        bindingConfiguration="WSDualHttpBinding_SampleDuplexHello"
        contract="SampleDuplexHello" 
        name="WSDualHttpBinding_SampleDuplexHello"
        behaviorConfiguration="enableCallbackDebug">
      </endpoint>
  </client>
<behaviors>
  <endpointBehaviors>
    <behavior name="enableCallbackDebug">
      <callbackDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </endpointBehaviors>
</behaviors>

Remarks

Set the IncludeExceptionDetailInFaults property to true from an application configuration file or programmatically to enable the flow of managed exception information in a client callback object back to the service for debugging purposes.

Caution

Returning managed exception information to services can be a security risk because exception details expose information about the internal client implementation that could be used by unauthorized services. In addition, although the CallbackDebugBehavior properties can also be set programmatically, it can be easy to forget to disable IncludeExceptionDetailInFaults when deploying.

Because of the security issues involved, it is strongly recommended that:

  • You use an application configuration file to set the value of the IncludeExceptionDetailInFaults property to true.

  • You only do so only in controlled debugging scenarios.

For more information about the security issues related to managed exception information, see Specifying and Handling Faults in Contracts and Services.

You can also set the values of this attribute by using the <callbackDebug> element in a client application configuration file.

Constructors

CallbackDebugBehavior(Boolean)

Initializes a new instance of the CallbackDebugBehavior class.

Properties

IncludeExceptionDetailInFaults

Gets or sets a value that controls whether client callback objects return managed exception information in SOAP faults back to the service.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEndpointBehavior.AddBindingParameters(ServiceEndpoint, BindingParameterCollection)

Implements the AddBindingParameters(ServiceEndpoint, BindingParameterCollection) method to support the behavior.

IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint, ClientRuntime)

Implements the ApplyClientBehavior(ServiceEndpoint, ClientRuntime) to support the behavior.

IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint, EndpointDispatcher)

Implements the ApplyDispatchBehavior(ServiceEndpoint, EndpointDispatcher) to support the behavior.

IEndpointBehavior.Validate(ServiceEndpoint)

Implements Validate(ServiceEndpoint) to support the behavior.

Applies to