在Soap Request PHP中使用xsi:type属性发送其他属性

时间:2015-03-05 07:26:00

标签: php soap attributes xsitype

我正在尝试在同一个请求标记中设置xsi:type和一些属性,并发送一个php soap请求。但是,我得到以下解组错误。有人可以建议一种方法来克服这个问题吗?

肥皂异常

致命错误:未捕获SoapFault异常:[soap:Client] Unmarshalling Error:意外元素(uri:"",local:" _")。预期元素为< {} iId>,< {} pId>在C:\ wamp \ www ...

肥皂请求

< request xsi:type =" ns1:PCType"的 xactionid ="的transactionId" > < PID> PID< / PID> < IID> IID< / IID> < /请求>

代码:

$request['_']['pId'] = 'pId';
$request['_']['iId'] = 'iId';

$request['xactionId'] = 'transactionid'; // it works when i comment this line :(

$request = new SoapVar($request, SOAP_ENC_OBJECT, "ns1:PCType", "" );
$r['request'] = $request;

$this->soapEnvelope = $r;

$apiResponse = $this->soapClient->__soapCall($this->apiFunc, $this->soapEnvelope, $this->soapHeader, array());

0 个答案:

没有答案