0

I have the following PHP code:

$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;

It works perfectly on my localhost, but when I upload it to the server, i get this error: enter image description here

What possible configuration could be wrong on the server, both my localhost and server run under PHP 5.6.31 / 5.6.38

  • Could you try to save the wsdl file locally. Perhaps aaacooper.com is blocking port 8188. – ivion Oct 30 '18 at 13:31
  • Yes, they provided the wsdl file. I've tried to run new SoapServer, but I still get error {Parsing WSDL: couldn't load from...} –  Oct 31 '18 at 07:20
  • No, I meant save the wsdl file locally to your filesystem. Not to load it from the Server. https://stackoverflow.com/questions/22157000/any-workaround-to-use-php-soapclient-with-a-local-wsdl-file-non-uri – ivion Oct 31 '18 at 08:26
  • Nope, still getting "Parsing WSDL: Couldn't load from " –  Oct 31 '18 at 14:21
  • Actually, the error is " Could not connect to host in /home4/factoryking/public_html/wp-content/themes/factoryking/api/indextest " –  Oct 31 '18 at 14:31
  • Could you load the wsdl file if your paste the url "http://wsportal.aaacooper.com:8188/wsGenRateEstimate.wsdl" to your browse, if so the server doesn't allow access the server. Or check the endpoint in your wsdl file. – ivion Oct 31 '18 at 14:41
  • I cannot load the wsdl file from my IP addess(94.155.242.198). HOWever, it loads when I use VPN and switch to canada IP(74.120.223.182) how is this possible? –  Oct 31 '18 at 14:59
  • Perhaps geoblocking. If you are using vpn, you are in there private network. So there are no restrictions. – ivion Oct 31 '18 at 15:43
  • @ivion No, they said that they are not blocking our IPs. Even when downloading the wsdl file, it still tries to connect to the endpoint which is http://wsportal.aaacooper.com:8188/wsportal20/wsGenEst, but it times out. –  Nov 05 '18 at 08:12

1 Answers1

0

I also faced the same issue while using AAACooper web service. It's working fine on localhost, but a SoapFault exception occurs on live server. In my case, it was not a mistake in the code, but the server location. My server location was Amsterdam--using server that has different server location fixed my problem. Also, I used 'proxy_host' => "wsportal.aaacooper.com", 'proxy_port' => 8188.

DaveL17
  • 1,673
  • 7
  • 24
  • 38
Vyshnav MK
  • 131
  • 1
  • 5