2013-04-01 105 views
0

我的問題是我試圖打電話給這對於用戶名密碼驗證Wss4jSecurityInterceptor的Web服務。命名空間的wsse:安全

其中生成請求是這樣的:

<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