You may need to attach your custom interceptor a bit farther down the chain (see bottom of here: http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors). It can take some trial and error to choose the right interceptor phase.

Glen

On 02.02.2011 14:30, Gagan wrote:
I am using following piece of code to set the response.

ByteArrayInputStream stream = new ByteArrayInputStream(
                                                        responseXML);
StreamSource source = new StreamSource(stream);
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
soapMessage.getSOAPPart().setContent(source);
soapMessage.saveChanges();

Message responseMsg = new MessageImpl();
responseMsg.setExchange(message.getExchange());
responseMsg = ep.getBinding()
                .createMessage(responseMsg);
message.getExchange().setOutMessage(responseMsg);
responseMsg.setContent(SOAPMessage.class, soapMessage);
responseMsg.setContent(InputStream.class, stream);

// responseMsg.setContent(InputStream.class, stream);
InterceptorChain chain = OutgoingChainInterceptor
                .getOutInterceptorChain(message.getExchange());
responseMsg.setInterceptorChain(chain);

chain.doInterceptStartingAfter(responseMsg,SoapPreProtocolOutInterceptor.class.getName());

But in the response I am getting empty envelope with nothing in body. Can
some one point out what is wrong.




--
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza


Reply via email to