0

My problem is i am trying to call a web service which has Wss4jSecurityInterceptor for username password authentication.

the request which is generated is like this :

<wsse:Security
            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
            SOAP-ENV:mustUnderstand="1">

this is not working but when i change the namespace i.e. xmlns:wsse

<wsse:Security
            xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
            SOAP-ENV:mustUnderstand="1">

it works fine.

i want to know how i can change the namespace that is generated with the <wsse:Security> tag from my code

Potherca
  • 13,207
  • 5
  • 76
  • 94
user2231986
  • 1
  • 1
  • 1

1 Answers1

0

You could extends EndpointInterceptorAdapter and override the method handleResponse like this:

@Override
public boolean handleResponse(MessageContext messageContext_, Object endpoint_) {

WebServiceMessage _webServiceMessage = messageContext_.getResponse();
SoapMessage _soapMessage = (SoapMessage) _webServiceMessage;


if (_soapMessage != null) {
SoapEnvelope _soapEnvelope = _soapMessage.getEnvelope();

if (_soapEnvelope != null) {

SoapHeader _soapHeader =_soapEnvelope.getHeader();
// modify the soapheader by casting to a DOMSource and manipulate the nodes
VirtualTroll
  • 3,077
  • 1
  • 30
  • 47