我有以下WSDL
消息部分元素不是valid.The元素"request:OTA_VehAvailRateRQ“和"response:OTA_VehAvailRateRS”没有在名称空间中定义,但是所有的imports和targetNamespaces似乎都没有问题。
我看不出有什么问题:
<?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>发布于 2014-11-20 15:02:28
Imports和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" />因此,request:OTA_VehAvailRateRQ的名称空间不会映射模式中元素OTA_VehAvailRateRQ的名称空间。
https://stackoverflow.com/questions/27028519
复制相似问题