Hi Bharat,
You could make your client extend class org.springframework.ws.client.core.support.WebServ iceGatewaySupport.
In there, use any of the sendAndReceive or marshalSendAndReceive methods as in the following piece of sample code:
Code:
getWebServiceTemplate().marshalSendAndReceive(yourDataRequest,
new WebServiceMessageCallback() {
@Override
public void doWithMessage(WebServiceMessage message)
throws IOException, TransformerException {
log.debug("adding soap aheader");
SaajSoapMessage soapMessage = (SaajSoapMessage) message;
soapMessage.getSoapHeader()
.addAttribute(new QName("correlation_ID"),"yourCorrelationId");
soapMessage.getSoapHeader()
.addAttribute(new QName("reply_to"), "yourReplyToAddress");
}
});
Hth,
- Sjoerd