【问题标题】:Can not find definition for element 'document'找不到元素“文档”的定义
【发布时间】:2013-09-15 15:01:33
【问题描述】:

我尝试进行 SOAP 调用,其中一个参数是 xml 本身。我的电话是这样的:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:ns1="vasws.GPAuftrag" 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/" 
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
    <ns1:insertOrder>
    <xmlAuftrag>
        <![CDATA[<?xml version="1.0" ?>
        <document>
            <header><client>029</client></header>
            <body><test>1</test></body>
        </document>]]>
    </xmlAuftrag>
    <ziel xsi:type="xsd:string">PISTEST</ziel>
    </ns1:insertOrder>
</SOAP-ENV:Body></SOAP-ENV:Envelope>

作为回报,我得到一个语法错误:

找不到元素“文档”的定义

我想我必须以某种方式定义document,但我不知道如何定义。我确实有一个 order.xsd 用于验证内部 xml。也许我必须以某种方式使用它?

如果有帮助的话,SOAP 调用会转到axis2 系统。在 API 定义中,我只给出了 &lt;header&gt;&lt;body&gt; 以及函数调用 insertOrder(xmlAuftrag, ziel),但没有定义它们的连接方式。

【问题讨论】:

    标签: java php xml soap axis2


    【解决方案1】:

    搜索order.xsd文件我发现了这个:

    <xs:element name="message">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="header" type="headerType"/>
                <xs:element name="body" type="bodyType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    

    这意味着&lt;document&gt;需要替换为&lt;message&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-02
      • 2019-02-25
      • 1970-01-01
      相关资源
      最近更新 更多