通过 PHP 调用 WSDL SOAP - 参数被忽略

WSDL SOAP call via PHP - parameters being ignored

我正在尝试使用远程 WSDL Web 服务中的某些过滤器。尝试这样做时我没有收到任何错误,但我得到的只是忽略了这些参数的完整数据列表。

调用 $client->__getFunctions() 检索到空白页,所以我不确定该怎么做。

这是XML:

<s:element name="Entities">
    <s:complexType>
        <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="Format" type="s:string"/>
            <s:element minOccurs="0" maxOccurs="1" name="wherefilter" type="s:string"/>
            <s:element minOccurs="0" maxOccurs="1" name="ordercondition" type="s:string"/>
        </s:sequence>
    </s:complexType>
</s:element>

这就是我尝试使用 PHP 的方式:

public static function fetch($name = 'Entities')
{
    $base = 'http://tempuri.org/';

    $client = new \SoapClient(null, [
        'location'   => '...',
        'uri'        => '...',
        'trace'      => 1,
        'exceptions' => true
    ]);

    $params = ['Format' => 'JSON'];

    try {
        // $params is being ignored
        $data = $client->__soapCall($name, $params, ['soapaction' => $base . $name]);

        return $data;
    }
    catch (\SoapFault $ex) {
        abort(403, $ex); 
    }
    catch (Exception $ex) {
        die($ex);
    }
}

任何关于我做错了什么的提示都将不胜感激。

在网上转了一圈寻找答案后,我不得不重新构造代码以使其正常工作。我不完全确定为什么旧设置不起作用,但现在它是这样工作的:

public static function fetch()
{
    $options = [
        'trace'         => 1,
        'exceptions'    => true
    ];

    $client = new \SoapClient('my_soap_url.asmx?WSDL', $options);

    try {
        $input = new \stdClass();
        $input->Format = "JSON";

        $data = $client->Entities($input);

        return reset($data);
    }
    catch (Exception $ex) {
        echo 'Caught exception: ',  $e->getMessage(), PHP_EOL . PHP_EOL;
        echo 'REQUEST:' . $client->__getLastRequestHeaders() . $client->__getLastRequest() . PHP_EOL . PHP_EOL;
        echo 'RESPONSE:' . $client->__getLastResponseHeaders() . $client->__getLastResponse();   
    }
}