4

注意:来自developer.jboss.org的交叉帖子

我们在 NGINX 后面配置了 Wildfly 10 作为反向代理来处理 Web 服务的 SSL 要求。Wildfly 将所有内容都作为纯 HTTP 提供服务,NGINX 处理请求的 HTTPS 端。

我们在 JBossWS 中启用了 uri 重写,并在standalone.xml

<subsystem xmlns="urn:jboss:domain:webservices:2.0">  
    <modify-wsdl-address>true</modify-wsdl-address>  
    <wsdl-host>jbossws.undefined.host</wsdl-host>  
    <wsdl-secure-port>8081</wsdl-secure-port>  
    <wsdl-uri-scheme>https</wsdl-uri-scheme>  

端点还使用自定义部署描述符:jboss-webservices.xml

<jboss:port-component>  
  <jboss:ejb-name>ClaimWebServiceBean</jboss:ejb-name>  
  <jboss:port-component-name>ClaimWSPort</jboss:port-component-name>  
  <jboss:port-component-uri>Claim</jboss:port-component-uri>  
  <jboss:transport-guarantee>CONFIDENTIAL</jboss:transport-guarantee>  
</jboss:port-component> 

SOAP 地址的 URI 重写和 WSDL 中包含的 XSD 的模式位置正常工作

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"   
  xmlns:tns="http://example.systems/webservices/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"   
  xmlns:ns1="http://example.co.za/claim/zmf" attributeFormDefault="unqualified" elementFormDefault="unqualified"   
  targetNamespace="http://example.systems/webservices/">  

  <xs:import namespace="http://example.co.za/claim/zmf" schemaLocation="https://dev.example.ws:8081/webservices/Claim?xsd=ZietoClaim_2_1.xsd"/>  
  <!-- xml omitted -->        

  <wsdl:service name="ClaimService">  
    <wsdl:port binding="tns:ClaimServiceSoapBinding" name="ClaimWSPort">  
      <soap12:address location="https://dev.example.ws:8081/webservices/Claim"/>  
    </wsdl:port>  
  </wsdl:service> 

在 WSDL 中引用的 XSD 包含另外 2 个导入语句来导入另外 2 个 XSD。然而,这就是问题开始的地方。在下面的摘录中,您会注意到架构位置使用http而不是https其他 2 个 XSD。

使用 curl 下载上面引用的 XSD 给出了这个内容,它显示了问题:

<?xml version='1.0' encoding='UTF-8'?>  
<xsd:schema xmlns:zdt="http://example.co.za/claim/zmf/datatypes" xmlns:zcdt="http://example.co.za/common/datatypes"   
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://example.co.za/claim/zmf" elementFormDefault="qualified"   
  targetNamespace="http://example.co.za/claim/zmf">  

  <xsd:import namespace="http://example.co.za/claim/zmf/datatypes" schemaLocation="http://dev.example.ws:8081/webservices/Claim?xsd=zmf_dt_2_1.xsd"/>  
  <xsd:import namespace="http://example.co.za/common/datatypes" schemaLocation="http://dev.example.ws:8081/webservices/Claim?xsd=zdt_1_2.xsd"/>  

有没有办法配置 JBossWS 来重写第一个 XSD 中的 shema 位置以及使用https

4

0 回答 0