SOAP请求适用于本地,但不适用于服务器

时间:2018-10-30 13:09:53

标签: php soap wsdl

我有以下PHP代码:

$params = array(
  'Token'=>'cf0a69ae-3174-43ca-8442-cdd001ebceee',
  'CustomerNumber'=>'000728438',
  'OriginCity'=>'Morristown',
  'OriginState'=>'TN',
  'OriginZip'=>'37814',
  'OriginCountryCode'=> 'USA',
  'DestinationCity'=> 'Avondale Estates',
  'DestinationState'=> 'GA',
  'DestinationZip'=> '30002',
  'DestinCountryCode'=> 'USA',
  'WhoAmI'=>'S',
  'BillDate'=>'121218',
  'CODAmount'=>'',
  'CODPayType'=>'',
  'CODFeePaidBy'=>'',
  'FullCoverage'=>'',
  'FullCoverageAmount'=>'',
  'PrePaidCollect'=>'',
  'TotalPalletCount'=>'',
  'AccLine'=>'',
  'RateEstimateRequestLine'=>array('Weight'=>'150', 'Class'=>'50', 'HandlingUnits'=>'', 'HandlingUnitType'=>'', 'Hazmat'=>'', 'CubeU'=>'', 'Length'=>'', 'Height'=>'','Width'=>'' ),
);


$client = new SoapClient("http://wsportal.aaacooper.com:8188/wsGenRateEstimate.wsdl", array('proxy_host'     => "68.183.29.131",
                                            'proxy_port'     => 3128,
                                            'proxy_login'    => "",
                                            'proxy_password' => ""));
$results = $client->__soapCall('wsGenRateEstimate', $params);

print_r($results);
die;

它在我的本地主机上完美运行,但是当我将其上传到服务器时,出现此错误: enter image description here

服务器上可能有什么配置错误,我的本地主机和服务器都在PHP 5.6.31 / 5.6.38下运行

1 个答案:

答案 0 :(得分:0)

我在使用 AAACooper Web 服务时也遇到了同样的问题。它在本地主机上工作正常,但在实时服务器上发生 SoapFault 异常。就我而言,这不是代码错误,而是服务器位置错误。我的服务器位置是阿姆斯特丹——使用具有不同服务器位置的服务器解决了我的问题。另外,我使用了 'proxy_host' => "wsportal.aaacooper.com", 'proxy_port' => 8188

相关问题