PHP SOAP 客户端__getLastRequest总是相同的


php soap client __getLastRequest always same

<?php
$opt = array(
    'currentPage' => '1',
    'pageSize' => '10',
    'productType' => 'TICKET'
);
$url = 'http://x.x.x.x/clutter/services/distributionService?wsdl';
$client = new SoapClient($url, array("trace" => 1));
$result = $client->productInfoList(array('parameters' => $opt));
var_dump($client->__getFunctions());
var_dump($client->__getLastRequest());
var_dump($client->__getLastResponse());

无论我更改$opt值传递给 soap 函数,请使用__getLastRequest始终返回:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://service.distribution.xxxx.com"><SOAP-ENV:Body><ns1:productInfoList><ns1:in0 xsi:nil="true"/></ns1:productInfoList></SOAP-ENV:Body></SOAP-ENV:Envelope>

永不改变。
而且我从来没有正确得到肥皂结果。
看起来参数没有传入请求。为什么?

响应是 soap XML。但它告诉我参数是错误的。我无法调试,因为__getLastRequest里面从来没有参数。

$result = $client->productInfoList(array('in0' => $str));

这行得通。

<ns1:in0 xsi:nil="true"/>

表示有一个名为 in0 的参数。

并且不应该传递数组。