function runRequest($message) { // Run the request initializeCommons(); //initialize common values $soap_do = initializeHeader($message); //initialize header // // Run the request // $result = curl_exec($soap_do); if (curl_errno($soap_do) != '') { //print curl_errno($soap_do) . ' - ' . curl_error($soap_do); header("Location: http://locationOfErrorpage/projects/Hotel/error.php"); //Use the location where you are keeping the error page } curl_close($soap_do); return $result; }
* $auth = base64_encode("Universal API/API1234567:mypassword"); * * The variable $TARGETBRANCH should be set to the TargetBranch provided by Travelport. * * (C) 2014 Travelport, Inc. * This code is for illustration purposes only. * Schema used (UAPI_8.0) */ // if (!isset($_SESSION)) { session_start(); } include_once 'phpSample_index.php'; // Sample Hotel Search request parameters: //common parameters initializeCommons(); //initialize targetBranch/userName etc... ////As of now these are hard coded, should be taken from other php/html forms, after initializing the values keep them in session for later use $LOCATION = $_SESSION["LOCATION"]; // Hotel Location you want to search $CHECKINDATE = $_SESSION["CHECKIN"]; // Checkin Date $CHECKOUTDATE = $_SESSION["CHECKOUT"]; // Checkout Date $NUMADULTS = $_SESSION["NUMADULTS"]; $TARGETBRANCH = $_SESSION["TARGETBRANCH"]; $PROVIDER = $_SESSION["PROVIDER"]; // // This is the SOAP request // // IMPORTANT: The SOAP envelope variables are case sensitive, be consistent!