我现在正在尝试通过 Ksoap 2.5 调用 Web 服务。我的问题是是否有自定义soap xml body?
现在 ksoap 生成以下代码片段:
<v:Envelope xmlns:v="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/">
<v:Header/>
<v:Body>
<n0:TVerifyCode xmlns:n0="urn:AccessDBIntf-IAccessDB" id="o0" c:root="1">
<UserId i:type="d:string">bfy</UserId>
<PassWord i:type="d:string">351F42CE0189FAD45AF2EA252A1F149A</PassWord>
</n0:TVerifyCode>
</v:Body>
</v:Envelope>
并且Web服务服务器抱怨“您提供的soap消息无效”。
如果我按以下方式更改代码段,代码将起作用:
<SOAP-ENV:Envelope 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/">
<SOAP-ENV:Body xmlns:NS1="urn:AccessDBIntf-IAccessDB" xmlns:NS2="urn:CommonObj" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:Login>
<VerifyCode href="#1"/>
</NS1:Login>
<NS2:TVerifyCode id="1" xsi:type="NS2:TVerifyCode">
<UserId xsi:type="xsd:string">bfy</UserId>
<PassWord xsi:type="xsd:string">F0639A434D0A852488F45A3071E009A6</PassWord>
</NS2:TVerifyCode>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
定制信封主体的任何想法?提前致谢!