Hi CXF-experts,
Some days ago, I asked my question about the expected behavior of the
WS-RM client. I am confused that the network exception is passed back
to the client application, while the RetransmissionInterceptor on the
client keeps retransmitting the message. I expected that the exception
would be handled by one of the RM interceptors so that the client
would not get the network exception directly.
(my original question
http://mail-archives.apache.org/mod_mbox/cxf-users/201005.mbox/%[email protected]%3e)
Looking further into the code today, I see that the exception is
passed back to the client because it is set both in message's content
and in its exchange map at the PhaseInterceptorChain's doIntercept
method below:
message.setContent(Exception.class, ex);
boolean isOneWay = false;
if (message.getExchange() != null) {
message.getExchange().put(Exception.class, ex);
isOneWay = message.getExchange().isOneWay();
}
unwind(message);
Later, the existence of the exception object is checked by the
ClientImpl class in its processResult method and if found, this throws
this exception to the client.
Here I have two questions.
1. why does my oneway method initiated by port.greetMeOneWay method of
the demo sample invoke the ClientImpl that calls the processResult
method? Isn't the processResult method only needed for
request-response processing?
2. If the processResult method is called for oneway calls, should the
RetransmissionInterceptor's handleFault method remove the exception
object from the message and its exchange map? If this is done, the
exception would not be removed during the unwind method of the
doInterceptor method above and the original exception would not be
forwarded to the client application. This seems to work for me.
I would appreciate if someone can answer my questions.
Thanks.
Regards, aki