我最近从PHP5.4升级到PHP7.男孩是一个改变,但这是不重要的.
自升级以来,我遇到了SoapService的问题.
这是我的SoapRequest在PHP5.4上的样子:
*redacted*
*redacted*
*redacted*
sha1
*redacted*
created
gt
2016-07-26
created
lt
2016-07-27
response
eq
A
true
0
9999
TransID
以下是在PHP7上运行完全相同的代码的请求:
*redacted*
*redacted*
*redacted*
sha1
*redacted*
Field
created
Type
gt
Value
2016-07-26
Field
created
Type
lt
Value
2016-07-26
Field
response
Type
eq
Value
A
true
0
9999
created
以下是相关的PHP代码:(注$sec)是已编辑的安全信息.
$param = array(
array('Field' => 'created', 'Type' => 'gt', 'Value' => date('Y-m-d', strtotime('2016-07-26'))),
array('Field' => 'created', 'Type' => 'lt', 'Value' => date('Y-m-d', strtotime('2016-07-26'))),
array('Field' => 'response', 'Type' => 'eq', 'Value' => 'A')
);
$matchAll = true;
$start = 0;
$limit = 9999;
$sort = 'TransID';
$this->advClient = new SoapClient($this->adv_wsdl, array('trace' => 1, 'exceptions' => 1, 'cache_wsdl' => WSDL_CACHE_BOTH, 'soap_version' => SOAP_1_2));
$result = $this->advClient->searchTransactions($sec, $searchParam, $matchAll, $start, $limit, $sort);
我最终得到的是一个错误.我认为问题是在PHP7中它包装并添加额外的“item”标签.但是有些功能仍然没有问题.还有其他人遇到过这个吗?
解决方法:
有趣的是,我使用了wsdltophp.com并为WSDL创建了一个类,一切正常.
标签:php,soap,web-services,php-7,soap-client
来源: https://codeday.me/bug/20190702/1353426.html