首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用import从两个XSD创建WSDL

使用import从两个XSD创建WSDL
EN

Stack Overflow用户
提问于 2014-11-20 06:48:00
回答 1查看 1.3K关注 0票数 0

我有以下WSDL

消息部分元素不是valid.The元素"request:OTA_VehAvailRateRQ“和"response:OTA_VehAvailRateRS”没有在名称空间中定义,但是所有的imports和targetNamespaces似乎都没有问题。

我看不出有什么问题:

代码语言:javascript
复制
    <?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 (请求)

代码语言:javascript
复制
    <?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>
EN

回答 1

Stack Overflow用户

发布于 2014-11-20 15:02:28

Imports和targetNamespaces似乎确实存在问题。

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

代码语言:javascript
复制
xmlns:request="http://www.karve.org/OTA_VehAvailRateRequest/"

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

代码语言:javascript
复制
<xs:import namespace="http://www.opentravel.org/OTA/2003/05"
           schemaLocation="OTA_VehAvailRateRQ.xsd" />

因此,request:OTA_VehAvailRateRQ的名称空间不会映射模式中元素OTA_VehAvailRateRQ的名称空间。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27028519

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档