" ."
en
";
echo "Testing connection $url:$port/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PORT, $port);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST , 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, "XMLRequest=".$eparcelRequest);
$responseBody = curl_exec($ch);
$status = curl_getinfo($ch);
curl_close ($ch);
echo "
Request ended without error";
} catch (Exception $e) {
echo "
Request ended with error
";
echo print_r($e,true)."";
$responseBody = 'error';
}
if ($status['http_code']==200) {
if (strpos(trim($responseBody), 'Passed";
}
else {
echo "Failed
";
echo "Able to communicate but did not receive a valid XML response
";
}
}
else {
echo "Failed to connect
";
echo "Communication error
";
}
echo "Details:
Response:\n";
echo htmlspecialchars ( $responseBody)."\n\nStatus\n";
echo print_r($status,true );
echo "";
?>