Daniel Kulp wrote:
>
> Here is the code that the JAX-WS SoapHandler things use for this. This
> may
> help. It MAY require the SAAJOutInterceptor configured in as well. Not
> really sure.
>
> Dan
>
>
> // server side inbound
> message.getInterceptorChain().abort();
> Endpoint e = message.getExchange().get(Endpoint.class);
> if (!message.getExchange().isOneWay()) {
> Message responseMsg = new MessageImpl();
> responseMsg.setExchange(message.getExchange());
> responseMsg =
> e.getBinding().createMessage(responseMsg);
> message.getExchange().setOutMessage(responseMsg);
> SOAPMessage soapMessage =
> ((SOAPMessageContext)context).getMessage();
>
> responseMsg.setContent(SOAPMessage.class,
> soapMessage);
>
> InterceptorChain chain =
> OutgoingChainInterceptor.getOutInterceptorChain(message
> .getExchange());
> responseMsg.setInterceptorChain(chain);
> // so the idea of starting interceptor chain from any
> // specified point does not work
> // well for outbound case, as many outbound
> interceptors
> // have their ending interceptors.
> // For example, we can not skip
> MessageSenderInterceptor.
> chain.doInterceptStartingAfter(responseMsg,
>
> SoapPreProtocolOutInterceptor.class.getName());
> }
>
Thank you very much !! It worked out of the box !
My issue is solved :-) And your code is far more clean than what I was
trying to do ;-)
Thanks again (and for all the other interesting posts too).
--
View this message in context:
http://cxf.547215.n5.nabble.com/Interceptors-sending-a-custom-response-before-invoking-the-service-tp2644637p2650870.html
Sent from the cxf-user mailing list archive at Nabble.com.