Soap Client __soapCall - 无声错误

时间:2016-12-13 10:38:53

标签: php soap soap-client

我正在尝试连接到Royal Mail Shipping API,我无法弄明白为什么在$ soapClient-> __ soapCall($ method,$ params)脚本停止执行。屏幕或日志中不会显示错误。

从本地文件中提取WSDL,__ getFunctions()返回可用的方法,所以我假设这很好。

创建soapClient对象:

    $soapClientOptions = array(
        'cache_wsdl' => 'WSDL_CACHE_NONE',
        'local_cert' => NULL,
        //'ssl_method' => 'SOAP_SSL_METHOD_SSLv3',
        'location' => $this->apiLocation,
        'stream_context' => stream_context_create($this->getAuthenticationHeaders()),
        'soap_version' => SOAP_1_1,
        'trace' => true,
        'exceptions' => true
    );

    try {
        $soapClient = new SoapClient($this->getStaticEndPoint(), $soapClientOptions);
    } catch(\SoapFault $fault){
        $error      =   "SOAP Fault: (faultcode: {$fault->faultcode}\n" ."faultstring: {$fault->faultstring})"; 
        echo $error;
    }catch(\Exception $exception){
        echo "<BR>".$exception;
    }
    $headerObject = new SoapVar($this->getWsseSecurityHeaders(), XSD_ANYXML);
    $header = new SoapHeader($this->moduleRoot.'/reference/oasis-200401-wss-wssecurity-utility-1.0.xsd', 'Security', $headerObject);
    $soapClient->__setSoapHeaders($header);

以下是__soapCall

的代码
    while (true) {
        try {
            $response = $soapClient->__soapCall('createShipment', array());
        } catch (\SoapFault $fault) {
            trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
        } catch (\Exception $e) {
            echo $e->getCode().': '.$e->getMessage();
        }
    }

SoapClient对象:

object(SoapClient)#1641 (6) {
  ["location"]=>
  string(37) "https://api.royalmail.net/shipping/v2"
  ["trace"]=>
  int(1)
  ["_stream_context"]=>
  resource(4652) of type (stream-context)
  ["_soap_version"]=>
  int(1)
  ["sdl"]=>
  resource(4653) of type (Unknown)
  ["__default_headers"]=>
  array(1) {
    [0]=>
    object(SoapHeader)#1640 (4) {
      ["namespace"]=>
      string(136) "/RoyalMailShipping/reference/oasis-200401-wss-wssecurity-utility-1.0.xsd"
      ["name"]=>
      string(8) "Security"
      ["data"]=>
      object(SoapVar)#1649 (2) {
        ["enc_type"]=>
        int(147)
        ["enc_value"]=>
        string(820) "

                user@domain.comAPI
                4d+PCTIxEWdlZA2Zr/OkvOXlTv4=
                MTAzMzg5Njc5NA==
                2016-12-13T10:20:46Z

        "
  }
  ["mustUnderstand"]=>
  bool(false)
}

} }

我不知道如何调试这个,因为我没有收到任何错误,我增加了php memory_limit,但这也没有帮助。我使用的是PHP 5.6.27版本

0 个答案:

没有答案