使用导入从两个XSD创建WSDL

使用导入从两个XSD创建WSDL,xsd,wsdl,xml-namespaces,xsd-validation,Xsd,Wsdl,Xml Namespaces,Xsd Validation,我有以下WSDL 消息部分元素无效。元素请求:OTA_VehAvailRateRQ和响应:OTA_vehavailrater未在名称空间中定义,但所有导入和目标名称空间似乎都没有问题 我无法看到问题: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <wsdl:definitions name="OTA_VehAvailRate" xmlns:soap="http://

我有以下WSDL

消息部分元素无效。元素请求:OTA_VehAvailRateRQ和响应:OTA_vehavailrater未在名称空间中定义,但所有导入和目标名称空间似乎都没有问题

我无法看到问题:

    <?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>

导入和targetNamespaces似乎确实存在问题

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

xmlns:request="http://www.karve.org/OTA_VehAvailRateRequest/"
但在XSD和导入中,您有以下名称空间:

<xs:import namespace="http://www.opentravel.org/OTA/2003/05"
           schemaLocation="OTA_VehAvailRateRQ.xsd" />
因此,请求的名称空间:OTA_VehAvailRateRQ不处理模式中元素OTA_VehAvailRateRQ的名称空间