2013-04-01 4 views
0

Моя проблема заключается в том, что я пытаюсь вызвать веб-службу с Wss4jSecurityInterceptor для аутентификации пароля пользователя.Пространство имен для wsse: security

запрос, который генерируется, как это:

<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">

это не работает, но когда я изменить пространство имен т.е. Xmlns: wsse

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

он отлично работает ,

я хочу знать, как я могу изменить пространство имен, которое генерируется с помощью тега из моего кода

ответ

0

Вы могли расширяющий EndpointInterceptorAdapter и переопределить метод handleResponse так:

@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