Robert Zilke created CXF-7965:
---------------------------------
Summary: Missing StaxOutEndingInterceptor in
OutFaultInterceptorChain leads to empty response
Key: CXF-7965
URL: https://issues.apache.org/jira/browse/CXF-7965
Project: CXF
Issue Type: Bug
Components: JAX-WS Runtime, WS-* Components
Affects Versions: 3.2.7
Environment: Java 8
Complete OutInterceptorChain:
{code:java}
setup [PolicyOutInterceptor]
pre-logical [HolderOutInterceptor, SwAOutInterceptor,
WrapperClassOutInterceptor, SoapHeaderOutFilterInterceptor]
post-logical [SoapPreProtocolOutInterceptor]
prepare-send [MessageSenderInterceptor]
pre-stream [SoapLoggingOutHandler, StaxOutInterceptor, XSLTOutInterceptor,
AttachmentOutInterceptor]
write [SoapOutInterceptor]
marshal [WrappedOutInterceptor, ExceptionInterceptor, BareOutInterceptor]
write-ending [SoapOutEndingInterceptor]
pre-stream-ending [StaxOutEndingInterceptor]
prepare-send-ending [MessageSenderEndingInterceptor]{code}
Complete FaultOutInterceptorChain:
{code:java}
setup [ServerPolicyOutFaultInterceptor]
pre-logical [SoapHeaderOutFilterInterceptor]
prepare-send [MessageSenderInterceptor, Soap11FaultOutInterceptor]
pre-stream [SoapLoggingOutHandler, AttachmentOutInterceptor, StaxOutInterceptor]
pre-protocol [WebFaultOutInterceptor]
write [SoapOutInterceptor]
marshal [Soap11FaultOutInterceptorInternal]
write-ending [SoapOutEndingInterceptor]
prepare-send-ending [MessageSenderEndingInterceptor]{code}
Reporter: Robert Zilke
My OutInterceptorChain looks like this:
{code:java}
...
pre-stream [SoapLoggingOutHandler, StaxOutInterceptor, XSLTOutInterceptor,
AttachmentOutInterceptor]
...
marshal [WrappedOutInterceptor, ExceptionInterceptor, BareOutInterceptor]
...
pre-stream-ending [StaxOutEndingInterceptor]
...{code}
I'm using an *XSLTOutInterceptor* for XSLT transformations, which is called
after the *StaxOutInterceptor*, so the *XSLTOutInterceptor* can use the
*XMLStreamWriter*, provided by the *StaxOutInterceptor.*
Additionally, the *StaxOutInterceptor* puts the *StaxOutEndingInterceptor* into
the interceptor chain.
This works fine if no interceptor throws an Exception in the handleMessage()
method.
In my scenario, the *ExceptionInterceptor* (in phase marshal) throws a
RuntimeException. My FaultOutInterceptorChain looks than like this:
{code:java}
...
pre-stream [SoapLoggingOutHandler, AttachmentOutInterceptor, StaxOutInterceptor]
...
pre-stream-ending []
...
{code}
The *StaxOutEndingInterceptor* is missing here which leads to an empty response
because the *StaxOutEndingInterceptor* has to close the *XMLStreamWriter*.
My current workaround is to invoke the *XSLTOutInterceptor* before the
*StaxOutInterceptor*, so the *XSLTOutInterceptor* will use the OutputStream
instead of the XMLStreamWriter.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)