php laravel SoapClient ErrorException数组到字符串的转换

时间:2018-11-02 19:08:17

标签: php laravel-5 soap

public static function tracking($tracking_id)
{    
    ini_set("soap.wsdl_cache_enabled", "0");
    $path_to_wsdl = Fedex::pathToWsdl().'TrackService_v12.wsdl';
    $client = new SoapClient($path_to_wsdl, array('trace' => 1)); 
    $request = Fedex::BasicRequest();
    $request['TransactionDetail'] = array('CustomerTransactionId' => '*** Tracking Request using PHP ***');
    $request['Version'] = Fedex::requestVersion('trck','12','0','0');
    $request['SelectionDetails'] = array(
        'PackageIdentifier' => array(
            'Type' => 'TRACKING_NUMBER_OR_DOORTAG',
            'Value' => $tracking_id
        )    
    );   
    $request['ProcessingOptions'] = array('INCLUDE_DETAILED_SCANS' => TRUE);

    try {
        if(setEndpoint('changeEndpoint')){
            $newLocation = $client->__setLocation(setEndpoint('endpoint'));
        }    

        $response = $client ->track($request);
        //dd($response);    

这是部分代码。错误指向第$response = $client ->track($request);行。 仅当$request['ProcessingOptions']存在时才会发生错误。如果我删除此行,或将名称更改为$request['ProcessingOption']或其他名称,该错误将消失。不知道为什么以及如何调试?

0 个答案:

没有答案