【问题标题】:How to setup HTTP Basic Authentication for SOAP Client within WebSphere Liberty如何在 WebSphere Liberty 中为 SOAP 客户端设置 HTTP 基本认证
【发布时间】:2018-09-05 15:47:04
【问题描述】:

我们正在尝试在 WebSphere Liberty 上部署 EAR。 我们的应用程序包含一个 EJB 模块,该模块包含调用另一个 SOAP 服务器的 EJB。 服务的 WSDL 定义了一个 wsp:Policy,ExactlyOne 为 http:BasicAuthentication xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http"/

部署后,当我们向应用程序发送请求时,会触发 SOAP 调用,我们会收到错误:None of the policy alternatives can be satisfied.

我找到了一些关于如何解决这个问题的 java 代码

HTTPConduit http = (HTTPConduit) client.getConduit(); 
http.getAuthorization().setUserName("user");
http.getAuthorization().setPassword("pass");

但我不想在 Java 代码中执行此操作,但我想将其作为服务器配置的一部分。

我找到了几个有用的链接,但仍然无法正常工作。 有人对我如何设置有任何建议吗?

https://www.ibm.com/support/knowledgecenter/en/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_wssec_migrating.html

https://www.ibm.com/support/knowledgecenter/en/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_sec_ws_clientcert.html

【问题讨论】:

    标签: http authentication soap client websphere-liberty


    【解决方案1】:

    您可以使用 JNDI 功能在 server.xml 中表达用户名和密码,然后让您的 java 代码将其从 JNDI 中提取出来。

    https://www.ibm.com/support/knowledgecenter/en/SSD28V_8.5.5/com.ibm.websphere.wlp.core.doc/ae/twlp_dep_jndi.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-20
      • 1970-01-01
      • 2017-11-14
      • 1970-01-01
      相关资源
      最近更新 更多