if (isRequestor(message)) {
// client side outbound
if (getInvoker(message).isOutbound()) {
message.getInterceptorChain().abort();
MessageObserver observer = (MessageObserver)message.getExchange().get(MessageObserver.class);
if (!message.getExchange().isOneWay()
&& observer != null) {
Endpoint e = message.getExchange().get(Endpoint.class);
Message responseMsg = e.getBinding().createMessage();
// the request message becomes the response message
message.getExchange().setInMessage(responseMsg);
SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage();
if (soapMessage != null) {
responseMsg.setContent(SOAPMessage.class, soapMessage);
XMLStreamReader xmlReader = createXMLStreamReaderFromSOAPMessage(soapMessage);
responseMsg.setContent(XMLStreamReader.class, xmlReader);
}
responseMsg.put(PhaseInterceptorChain.STARTING_AT_INTERCEPTOR_ID,
SOAPHandlerInterceptor.class.getName());
observer.onMessage(responseMsg);
}
//We dont call onCompletion here, as onCompletion will be called by inbound
//LogicalHandlerInterceptor
} else {
// client side inbound - Normal handler message processing