我尝试进行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'的定义
我想我必须以某种方式定义document
,但我不知道如何。我确实有order.xsd
来验证内部xml。也许我不得不以某种方式使用它?
如果有任何帮助,SOAP调用将转到axis2系统。在API定义中,我只定义了<header>
和<body>
以及函数调用insertOrder(xmlAuftrag, ziel)
,但没有定义如何连接它们。
答案 0 :(得分:0)
通过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>
这意味着<document>
需要替换为<message>
。