使用导入从两个 XSD 创建 WSDL



我有以下WSDL

消息部分元素无效。元素"request:OTA_VehAvailRateRQ"和"response:OTA_VehAvailRateRS"没有在命名空间中定义,但所有导入和目标命名空间似乎都没有问题。

我无法:(看到问题

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <wsdl:definitions
        name="OTA_VehAvailRate"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.karve.org/OTA_VehAvailRate/"
        xmlns:tns="http://www.karve.org/OTA_VehAvailRate/" 
        xmlns:request="http://www.karve.org/OTA_VehAvailRateRequest/"
        xmlns:response="http://www.karve.org/OTA_VehAvailRateResponse/">
    <wsdl:types>  
      <xs:schema targetNamespace="http://www.karve.org/OTA_VehAvailRate/">    
        <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="OTA_VehAvailRateRQ.xsd" />            
        <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="OTA_VehAvailRateRS.xsd" />    
      </xs:schema>  
    </wsdl:types>
    <!--  These messages fails in the wsdl:part element -->
    <wsdl:message name="OTA_VehAvailRateRequest"> 
      <wsdl:part element="request:OTA_VehAvailRateRQ" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="OTA_VehAvailRateResponse">
      <wsdl:part element="response:OTA_VehAvailRateRS" name="parameters"/>
    </wsdl:message>
    ........ Rest of WSDL ......

这是我的这个 XSD(请求)

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema 
        xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        xmlns="http://www.opentravel.org/OTA/2003/05"         
        targetNamespace="http://www.opentravel.org/OTA/2003/05" 
        elementFormDefault="qualified" version="2.000" id="OTA2010A">
      <xs:element name="OTA_VehAvailRateRQ">
        <xs:complexType>
        .........
        </xs:complexType>
      </xs:element>
    </xs:schema>

导入和目标命名空间似乎确实有问题。

在 WSDL 中定义以下命名空间:

xmlns:request="http://www.karve.org/OTA_VehAvailRateRequest/"

但在 XSD 和导入中,您具有以下命名空间:

<xs:import namespace="http://www.opentravel.org/OTA/2003/05"
           schemaLocation="OTA_VehAvailRateRQ.xsd" />

因此,request:OTA_VehAvailRateRQ的命名空间不会占用架构中OTA_VehAvailRateRQ元素的命名空间。

最新更新