我需要使用一个WS,它需要客户机(机器)证书。更准确地说,它使用了http://docs.oasis-open.org/wss-m/wss/v1.1.1/os/wss-SOAPMessageSecurity-v1.1.1-os.html定义的WS-Security : SOAP消息安全性、WS-Security : X.509证书令牌配置文件
使用本机使用者,Domino不会(神奇地)在SOAP头中添加身份验证。现在我该如何在头文件中添加安全性呢?最好在LotusScript..。
无论如何,我不认为可以将使用者嵌入到我自己的标题中,或者丰富现有的使用者。我加入了IBM对此的响应。
所以我的问题是:
IBM响应:
我们了解到,您正在尝试使用SOAP头进行身份验证。不幸的是,目前不支持这一点。作为您的参考,我们至少有两个与本主题相关的增强请求(在此领域中我可以找到):
SPR # SODY9H6BTM:创建自己的Soap对象不支持Web代理中的客户端证书身份验证。
SPR # JSHN7A3MLP: WS消费SOAP信封的标头元素中的身份验证数据,不幸的是,此时我们无法进一步支持它。
发布于 2016-01-10 19:10:41
如果我正确地理解了您的问题,您就不知道如何处理SOAP头,如果是这样的话,您可能需要知道两件事:
1)使用本地Domino使用者方法传递会话。见下面的例子
TestServiceLocator service = new TestServiceLocator();
TestPort port = service.getTestPort();
// that would tell to save cookie session between calls
((javax.xml.rpc.Stub)port)._setProperty(javax.xml.rpc.Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);2)如果它对您不起作用,您可以尝试使用本地SOAP方法。我最近在博客上写道:SOAP和传递会话
// Create SOAP Connection
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
// connect to webserivce
SOAPMessage soapResponse = soapConnection.call(connect(username, password), url);
// read cookie from response and use it when send another requests
MimeHeaders session = soapResponse.getMimeHeaders();
String sesisonCookie = session.getHeader("Set-Cookie")[0];
SOAPMessage soapResponse2 = soapConnection.call(customerGetAll(sesisonCookie), url);
soapConnection.close();而不是想象你在customGetAll方法中
SOAPBody soapBody = envelope.getBody();
SOAPElement soapBodyElem = soapBody.addChildElement("Customer_GetAll", "m");
soapMessage.getMimeHeaders().addHeader("Cookie", sesisonCookie);
soapMessage.saveChanges();希望能帮上忙。
https://stackoverflow.com/questions/34703564
复制相似问题