【问题标题】:How to configure Apache Proxy to correctly return JAX-WS WSDL XSD location如何配置 Apache 代理以正确返回 JAX-WS WSDL XSD 位置
【发布时间】:2019-11-07 08:54:06
【问题描述】:

我需要在本地 Apache 代理后面的 Weblogic 应用服务器上发布 JAX-WS Web 服务。 Weblogic 服务器配置为仅侦听 localhost 请求,Apache 代理使用 ProxyPassProxyPassReverse 将传入的请求通过 http://myServer/myService 重定向到应用程序服务器 http://localhost:1234/myService (有一个 RewriteRule 用于传输 al http : 到 https 的流量:)。

当我通过http://myServer/myService?wsdl 请求我的 SOAP 服务的 WSDL 时,我得到了预期的 WSDL,但是 WSDL 的 xsd schemaLocation 部分再次指向 localhost,正如预期的那样(因为 web 服务是从 localhost 有效调用的):

<types>
  <xsd:schema>
    <xsd:import schemaLocation="http://localhost:1234/myService?xsd=1" namespace="http://myService.myCompany.com"/>
  </xsd:schema>
</types>

当我通过 schemaLocation xsd URL 将 localhost 替换为正确的服务器名称来请求 xsd 时,xsd 看起来与我预期的一样。由于 localhost 部分肯定是错误的,我更改了 Apache 配置以通过将 ProxyPerserveHost On 添加到我的 httpd 配置文件来保留调用者主机名,返回的 wsdl 再次指向 myServer,正如我所料:

<types>
  <xsd:schema>
    <xsd:import schemaLocation="http://myServer:80/myService?xsd=1" namespace="http://myService.myCompany.com"/>
  </xsd:schema>
</types>

再次,从该 URL 检索 xsd 工作正常,xsd 有效并且看起来与预期一样。当我尝试从 URL http://myServer/myService?wsdl 创建 SoapUI SOAP 项目时,我收到错误 org.apache.xmlbeans.XmlException: error: Unexpected end of file after null

当我从没有 Apache 代理的 Weblogic 服务器上的相同部署中检索相同的 WSDL 时,即使我在没有原始服务器上的代理的情况下直接调用服务,一切正常。

我必须如何正确配置我的 Apache 代理才能使用动态 WSDL 交付并返回有效的 wsdl 和 xsd,而无需手动创建带有嵌入式 xsd 的 wsdl 文件?

【问题讨论】:

    标签: apache wsdl jax-ws weblogic12c mod-proxy


    【解决方案1】:

    好吧,看来是我自己想出来的……

    问题似乎出在端口上。最初,xsd schemaLocation 被指定为http://myServer:80。在应用程序服务器部署配置中禁止 http: 流量到我的部署后,端口正确返回为 443,这使得其他一切也正常工作:

    <types>
      <xsd:schema>
        <xsd:import schemaLocation="https://myServer:443/myService?xsd=1" namespace="http://myService.myCompany.com"/>
      </xsd:schema>
    </types>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-04
      • 1970-01-01
      相关资源
      最近更新 更多