我的问题是,我试图调用一个具有Wss4jSecurityInterceptor的web服务来进行用户名密码身份验证。
生成的请求如下:
<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">效果很好。
我想知道如何更改由代码中的<wsse:Security>标记生成的命名空间。
发布于 2013-04-01 15:55:25
您可以像这样扩展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 nodeshttps://stackoverflow.com/questions/15743303
复制相似问题