2016-04-25 76 views
2

我有一個帶有nuSoap(PHP)的SOAP服務器,我試圖導入/包含xsd,但驗證器WSDL顯示下一個錯誤:Src-resolve:無法解析名稱'OTA_PayloadStdAttributes'到'(n)'屬性組'

Src-resolve: Cannot Resolve The Name 'OTA_PayloadStdAttributes' To A(n) 'attribute Group' Component.

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

編輯

添加驗證的所有WSDL,XSD和URL

+0

您應該發佈[mcve]。 – kjhughes

+0

您的編輯甚至不會創建[mcve]。 – kjhughes

回答

1

OTA_PayloadStdAttributes無處出現在您的WSDL的XSD的;它必須位於您未顯示的其中一個導入的XSD中。

  1. 查找引用OTA_PayloadStdAttributes屬性組的XSD。
  2. 確定OTA_PayloadStdAttributes屬性組的定義是否位於XSD中直接或間接引用它的位置。
  3. 如果不是,請直接或間接添加缺失的定義(通過xsd:includexsd:import - what's the difference?)。
  4. 如果是這樣,請檢查引用及其定義的名稱空間是否匹配。

這是關於具體,因爲我們可以給你,你還沒有發佈一個MCVE。

+0

我一直在測試,但我仍然找到解決方案。如果您能找到解決方案,我添加了實際的代碼。 –

+0

正如我在你的問題的評論中提到的那樣,你應該創建一個[mcve],而不是要求那些能夠幫助你瀏覽如此多餘的材料的人。你也有責任爲未來的讀者創建一個獨立的問題,而不是依賴於可能破壞的外部鏈接。 – kjhughes