SOAP Web services only return exception information to a consumer when the contract includes a SOAP fault message. Services implemented with Fuse Services Framework can be configured to generate a SOAP fault message that returns the stack trace from a server-side exception when no fault message is specified.
The messages passed between a Web service consumer and a Web service provider is prescribed by the WSDL defining the service. Because of this, Web service providers do not always return fault messages to the consumer when an exception occurs and the consumer has no way of knowing something is wrong unless the service provider dies.
Service providers implemented using Fuse Services Framework can be configured, via a property, to return a SOAP fault containing the stack trace when an exception is returned. For security reasons, service providers do not provide the causing exception as part of the stack trace. This behavior can also be changed.
To configure a service provider to propagate stack trace information in a SOAP fault,
you set the endpoint property faultStackTraceEnabled to true.
Example 6.1 shows the configuration for an endpoint that
propagates stack trace information.
Example 6.1. Enabling stack trace propagation
<jaxws:endpoint id="router" address="http://localhost:9002/TestMessage" wsdlURL="ship.wsdl" endpointName="s:TestSoapEndpoint" serviceName="s:TestService" xmlns:s="http://test"> <jaxws:properties> <!-- enable sending the stack trace back to client --> <entry key="faultStackTraceEnabled" value="true" /> </cxf:properties> </cxf:cxfEndpoint>
For security reasons, the stack trace does not include the causing exception (that is,
the part of a stack trace that follows Caused by). If you want to include the
causing exception in the stack trace, set the exceptionMessageCauseEnabled
property to true. Example 6.2 shows the
configuration for an endpoint that propagates the causing exception.
Example 6.2. Enabling stack trace propagation with the causing exception
<jaxws:endpoint id="router" address="http://localhost:9002/TestMessage" wsdlURL="ship.wsdl" endpointName="s:TestSoapEndpoint" serviceName="s:TestService" xmlns:s="http://test"> <jaxws:properties> <!-- enable the showing of the causing exception message --> <entry key="exceptionMessageCauseEnabled" value="true" /> <!-- enable sending the stack trace back to client --> <entry key="faultStackTraceEnabled" value="true" /> </cxf:properties> </cxf:cxfEndpoint>
![]() | Warning |
|---|---|
You should only enable the |






![[Warning]](imagesdb/warning.gif)

