Hi timberlinetom,
Mhmm, I guess that the truncated return is not read correctly by the plugin.
I think that USPS changed their servers which now only manage HTTP/1.1
The plugin developed by an external developer/company (who gave us the plugin for free) does not handle the connection like we did generally.
Well, I rewrite the function "doUPS" in order to use cURL and not a raw socket. It is quite better to respect standards and have a right processed result.
Please test this new function, I hope that it will return a better result.
function doUSPS($XMLRequest, $domesticShipment) {
$apiName = 'RateV4';
// Change API name if this is an International shipment.
// Determined by $domesticShipping boolean value.
//
if($domesticShipment == false)
$apiName = 'IntlRateV2';
$url = 'http://production.shippingapis.com/ShippingAPI.dll?API=' . $apiName . '&XML=' . urlencode($XMLRequest);
$session = curl_init();
curl_setopt($session, CURLOPT_FRESH_CONNECT, true);
curl_setopt($session, CURLOPT_POST, false);
curl_setopt($session, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($session, CURLOPT_FAILONERROR, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($session, CURLOPT_COOKIEFILE, '');
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($session, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($session, CURLOPT_ENCODING, 'UTF-8');
curl_setopt($session, CURLOPT_URL, $url);
$result = curl_exec($session);
$error = curl_error($session);
if(empty($result)) {
$app = JFactory::getApplication();
$app->enqueueMessage( 'Cannot connect to USPS web service. You hosting company might be blocking outbound connections.<br/>'.$error);
return false;
}
$responseDoc = simplexml_load_string($result);
if($responseDoc === false) {
$app = JFactory::getApplication();
$app->enqueueMessage('Cannot dialog with USPS web service.<br/>'.$result);
return false;
}
return $responseDoc;
}
@Julian56 : I said you a high number of time that if you want to help you can make some tests, follow this thread and like the other people, try some things to solve the problem. But asking like you did, will not help anything.
We know that it is a big problem but.. sending us a lot of messages without any useful information does not help.
I prefer to be direct and honest. I hope that I am clear enough and that you understand that we also want to solve this problem as fast as possible.
At the moment that we will have a news, you will know because we concentrated the USPS problem on this single thread.
Regards,