1
我的SOAP请求中有一个深度为几个级别的数组,如下所示。当我运行我的SoapRequest时,我得到Notice(8):Array to string conversion,而我的XML响应不会将RTrans中的Array转换为XML,我不知道为什么。我如何创建SOAP请求及其XML版本可以在下面找到。php soapclient数组到字符串转换
的请求:
$r['request'] = array(
'request' => array(
'user' => 'test',
'password' => 'test',
'RTrans' => array(
'Transactions' => array(
'Criteria' => array(
'Name' => 'Thomas'
)
)
)
)
);
try{
$response = $this->apiClient->DoQuery($r);
}
catch(Exception $e){
debug($e);
}
XML版本
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://webServices/">
<SOAP-ENV:Body>
<ns1:DoNormalEnquiry>
<request>
<username>test</usernmae>
<password>test</password>
<RTrans>Array</RTrans>
</request>
</ns1:DoNormalEnquiry>
</SOAP-ENV:Body>
从我知道它期待一个XML字符串,所以我应该有它在这种格式 RTRANS =“<交易>托马斯 交易>”; –
user1005319
2014-08-27 12:18:41