【问题标题】:Src-resolve: Cannot Resolve The Name 'OTA_PayloadStdAttributes' To A(n) 'attribute Group' Componentsrc-resolve:无法将名称“OTA_PayloadStdAttributes”解析为 A(n)“属性组”组件
【发布时间】:2016-04-25 11:16:07
【问题描述】:

我有一个带有 nuSoap (PHP) 的 SOAP 服务器,我正在尝试导入/包含 xsd,但验证器 WSDL 显示下一个错误:

Src-resolve:无法将名称“OTA_PayloadStdAttributes”解析为 A(n)“属性组”组件。

<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://otatest.goldcar.es/OpenTravel_2015B_XML" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:elementFormDefault="qualified" xmlns:version="2.000" xmlns:id="OTA2015B" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://otatest.goldcar.es/OpenTravel_2015B_XML">
<types>
<xsd:schema elementFormDefault="qualified" version="2.000" id="OTA2015B" targetNamespace="http://otatest.goldcar.es/OpenTravel_2015B_XML"
>

 <xsd:import schemaLocation="http://otatest.goldcar.es/OpenTravel_2015B_XML/OTA_CommonTypes.xsd" />
 <xsd:import schemaLocation="http://otatest.goldcar.es/OpenTravel_2015B_XML/OTA_VehicleCommonTypes.xsd" />

   <!-- <xsd:include namespace="http://otatest.goldcar.es/OpenTravel_2015B_XML" schemaLocation="http://otatest.goldcar.es/OpenTravel_2015B_XML/OTA_VehResNotifRQ.xsd"/>
   <xsd:include namespace="http://otatest.goldcar.es/OpenTravel_2015B_XML" schemaLocation="http://otatest.goldcar.es/OpenTravel_2015B_XML/OTA_VehResNotifRS.xsd"/> -->

</xsd:schema>
</types>
<message name="OTA_VehResNotifRQ">
  <part name="POS" type="xsd:string" />
  <part name="Reservations" type="xsd:string" /></message>
<message name="OTA_VehResNotifRS">
  <part name="Return" type="xsd:string" /></message>
<portType name="GoldcarPortType">
  <operation name="OTA_VehResNotifRQ">
    <documentation>This message will push reservation details to a trading partner. The information pushed may establish this reservation initially in a trading partner's database and/or update the information that currently exists.</documentation>
    <input message="tns:OTA_VehResNotifRQ"/>
    <output message="tns:OTA_VehResNotifRS"/>
  </operation>
</portType>
<binding name="GoldcarBinding" type="tns:GoldcarPortType">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="OTA_VehResNotifRQ">
    <soap:operation soapAction="http://otatest.goldcar.es/#OTA_VehResNotifRQ" style="rpc"/>
    <input><soap:body use="encoded" namespace="http://otatest.goldcar.es/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    <output><soap:body use="encoded" namespace="http://otatest.goldcar.es/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  </operation>
</binding>
<service name="Goldcar">
  <port name="GoldcarPort" binding="tns:GoldcarBinding">
    <soap:address location="http://localhost/ota2sarg2/nuevo_server.php"/>
  </port>
</service>
</definitions>

XSD 上是 OTA_PayloadStdAttributes http://otatest.goldcar.es/OpenTravel_2015B_XML/OTA_VehResNotifRQ.xsd

验证器显示错误 http://freeformatter.com/xml-validator-xsd.html

编辑

添加Validator的所有WSDL、XSD和URL

【问题讨论】:

标签: xml xsd wsdl xsd-validation nusoap


【解决方案1】:

OTA_PayloadStdAttributes 不会出现在 WSDL 的 XSD 中;它必须在您未显示的导入 XSD 之一中。

  1. 查找引用 OTA_PayloadStdAttributes 属性组的 XSD。
  2. 确定OTA_PayloadStdAttributes 属性组的定义是否在直接或间接引用它的XSD 中。
  3. 如果没有,请直接或间接添加缺少的定义(通过xsd:includexsd:import -- what's the difference?)。
  4. 如果是,请检查引用的命名空间及其定义是否匹配。

鉴于您尚未发布 MCVE,这与我们所能得到的一样具体。

【讨论】:

  • 我一直在测试,但我仍然找到了解决方案。如果您能帮助找到解决方案,我添加了实际代码。
  • 正如我在 cmets 中对您的问题所提到的,您应该创建一个minimal reproducible example,而不是询问那些会帮助您浏览这么多多余材料的人。您还有义务为未来的读者创建一个独立的问题,而不是依赖于可能中断的外部链接。
猜你喜欢
  • 1970-01-01
  • 2013-01-31
  • 2013-09-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-04
  • 2012-04-10
  • 1970-01-01
相关资源
最近更新 更多