【问题标题】:JBoss 7.1 JAX-WS webservice behind Reverse proxy, https to http transformation反向代理背后的 JBoss 7.1 JAX-WS webservice,https 到 http 转换
【发布时间】:2015-10-02 18:51:46
【问题描述】:

我已经部署了一个托管在 JBoss 7.1.1 中的 JAX-WS Web 服务。 Web 服务由反向代理访问。 要从公共 Internet 访问服务,必须通过 https 协议完成,但反向代理和 JBoss 之间的通信是在 http 中。 所以 wsdl 文件中存在的主机是 http <soap:address location="http://example.com/WS"/> 它必须是 <soap:address location="https://example.com/WS"/>.

JBoss配置如下:

modify-wsdl-addres = true


wsdl-host = jbossws.undefined.host

这里是 webservices 配置的参考: https://docs.jboss.org/author/display/AS71/Web+services+configuration

但我可以在肥皂地址中找到强制协议为 https 的位置。

【问题讨论】:

    标签: wsdl jax-ws jboss7.x reverse-proxy jboss-eap-6


    【解决方案1】:

    我刚刚遇到了同样的问题并调试了 JBoss 7.1.1。 事实证明,它在部署时确定 URL 并查看“传输保证”配置,该配置可以以各种位置和格式提供。

    我已经这样注释了我的 Web 服务:

    @org.jboss.ws.api.annotation.WebContext(transportGuarantee="CONFIDENTIAL")
    public class SomeServiceEndpoint implements SomeServiceInterface {
        ...
    }
    

    我正在使用标准 http 连接器并像这样配置 web 服务子系统

    <subsystem xmlns="urn:jboss:domain:webservices:1.2">
        <modify-wsdl-address>true</modify-wsdl-address>
        <wsdl-host>proxy.com</wsdl-host>
        <wsdl-secure-port>443</wsdl-secure-port>
    </subsystem>
    

    编辑:
    我注意到 http 连接器需要具有 proxy-name 和 proxy-port 属性才能接受代理发出的纯 HTTP 请求。
    安全和方案属性对 Servlet 等很有用,例如用于创建 URL。

    <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host">
        <connector name="http" protocol="HTTP/1.1"
                   socket-binding="http" executor="http"
                   scheme="https" secure="true" 
                   proxy-name="proxy.com" proxy-port="443"/>
        ...
    </subsystem>
    

    【讨论】:

    • 我现在无法测试,但我不确定是否可以修复主机名
    【解决方案2】:

    webwebservices 子系统配置共同提供端点 URL(以及 xs:import 语句的 URL)。

    webservices 配置中添加以下行

    <wsdl-port>443</wsdl-port>
    

    web 配置中,将http 连接器的方案从http 更改为https 并添加proxy-port="443"

    所以它看起来像这样:

    <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
        <connector name="http" protocol="HTTP/1.1" scheme="https" socket-binding="http" 
         secure="true" proxy-port="443"/>
         ...
    </subsystem>
    <subsystem xmlns="urn:jboss:domain:webservices:1.2">
        <modify-wsdl-address>true</modify-wsdl-address>
        <wsdl-host>jbossws.undefined.host</wsdl-host>
        <wsdl-port>443</wsdl-port>
        ...
    </subsystem>
    

    【讨论】:

    • 有道理,但我现在无法访问该服务来测试它。 :(
    猜你喜欢
    • 1970-01-01
    • 2010-09-21
    • 2017-07-10
    • 1970-01-01
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 2020-11-24
    • 1970-01-01
    相关资源
    最近更新 更多