Endpoint e = message.getExchange().get(Endpoint.class);
Message responseMsg = new MessageImpl();
responseMsg.setExchange(message.getExchange());
responseMsg = e.getBinding().createMessage(responseMsg);
MessageObserver observer = message.getExchange()
.get(MessageObserver.class);
if (observer != null) {
//client side outbound, the request message becomes the response message
responseMsg.setContent(XMLStreamReader.class, message
.getContent(XMLStreamReader.class));
message.getExchange().setInMessage(responseMsg);
responseMsg.put(PhaseInterceptorChain.STARTING_AT_INTERCEPTOR_ID,
LogicalHandlerInInterceptor.class.getName());
observer.onMessage(responseMsg);
}
return;
}
} else {
// server side - abort