Open tiimka opened 7 years ago
Hi tiimka,
The URL being used is incorrect for AirAvailability. The URL you are using is a UtilService url and we have to use AirService. Please find below the corrected URL. Could you please try with this and let us know how it goes. Thanks.
$soap_do = curl_init ("https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService");
Hello vivekjyotipramanik , thanks for your prompt response , but unfortunately is not working yet.
Hi tiimka,
Could you please share the code after updating the endpoint URL to AirService. Also, Could you please try with http://demo.travelportuniversalapi.com/ using your credentials or try in SOAP UI using your credentials if the credentials are fine and is working. Please let us know how it goes. Thanks.
The updated code is here <?php /*
This code is for illustration purposes only. */ $TARGETBRANCH = 'P7002784'; $CREDENTIALS = 'Universal API/uAPI4701060469-34e29710:QBMn4bJmkGH9AEPZbcHat7qXm'; $Provider = 'ACH'; // Any provider you want to use like 1G/1P/1V/ACH $message = <<<EOM
By connecting this URL (https://emea.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/) and passing our credentials we receive this error Error 500: java.lang.StringIndexOutOfBoundsException
Hi tiimka,
The URL is incomplete, it should append the service, like, https://emea.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService. Also, looks like you are trying through browser, it will need to e test with SOAP UI. Could you please check with demosite as well using your credentials. Thanks.
Sorry vivekjyotipramanik , The link is what we received from Welcome email and even if I Used this link shows the same error https://emea.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService.
Hi tiimka,
Could you please confirm where you are using the link. The link will not work from browser, it has to be used from SOAP UI or code only. Could you please send the credentials in my email. I will check the credentials if they are fine. Thanks.
Hi tiimka,
We can also schedule an webex to see and resolve the issue. Please let me know your timezone and your preferred time and date and we will schedule the meeting. Thanks.
@vivekjyotipramanik Hello vivekjyotipramanik I am testing if this message is public or private to you only.
Best
...
Sent an email
Hello clicking this link https://emea.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService and entering the credentials I receive this error Error 500: java.lang.StringIndexOutOfBoundsException
Hi tiimka,
Could you please confirm where you are running the xml request and the xml request which you are using. Just clicking on the link will not work, this is a endpoint URL and not a borwser URL. We haev to use tools like postman or soap ui and use the endpoint and send request xml in postman or soap ui to get the proper response. Please find below the link with all the steps. Please let us know how it goes. Thanks.
Dear All, We are very happy to join the users of Travelport's API , we are facing an error "Processing! Please wait! Fatal error: Error occurred request/response processing! in E:\xampp\htdocs\Air\phpSample_Air.php on line 100" We have updated the account credentials and also the future departure date could you please help us. bellow is the code in file. <?php /*
This code is for illustration purposes only. */ $TARGETBRANCH = 'P7002784'; $CREDENTIALS = 'Universal API/uAPI4701060469-34e29710:QBMn4bJmkGH9AEPZbcHat7qXm'; $Provider = 'ACH'; // Any provider you want to use like 1G/1P/1V/ACH $message = <<<EOM
'; //echo $return; //print '
'; //print_r(curl_getinfo($soap_do)); //Pretty print XML function prettyPrint($result,$file){ $dom = new DOMDocument; $dom->preserveWhiteSpace = false; $dom->loadXML($result); $dom->formatOutput = true; //call function to write request/response in file outputWriter($file,$dom->saveXML()); return $dom->saveXML(); } //function to write output in a file function outputWriter($file,$content){ file_put_contents($file, $content); // Write request/response and save them in the File } function parseOutput($content){ //parse the Search response to get values to use in detail request $AirAvailabilitySearchRsp = $content; //use this if response is not saved anywhere else use above variable //echo $AirAvailabilitySearchRsp; $xml = simplexml_load_String("$AirAvailabilitySearchRsp", null, null, 'SOAP', true); if($xml) echo "Processing! Please wait!"; else{ trigger_error("Encoding Error!", E_USER_ERROR); } $Results = $xml->children('SOAP',true); foreach($Results->children('SOAP',true) as $fault){ if(strcmp($fault->getName(),'Fault') == 0){ trigger_error("Error occurred request/response processing!", E_USER_ERROR); } } $count = 0; $fileName = "flights.txt"; if(file_exists($fileName)){ file_put_contents($fileName, ""); } foreach($Results->children('air',true) as $nodes){ foreach($nodes->children('air',true) as $hsr){ if(strcmp($hsr->getName(),'AirSegmentList') == 0){ foreach($hsr->children('air',true) as $hp){ if(strcmp($hp->getName(),'AirSegment') == 0){ $count = $count + 1; file_put_contents($fileName,"\r\n"."Air Segment ".$count."\r\n"."\r\n", FILE_APPEND); foreach($hp->attributes() as $a => $b ){ $GLOBALS[$a] = "$b"; //echo "$a"." : "."$b"; file_put_contents($fileName,$a." : ".$b."\r\n", FILE_APPEND); } } } } //break; } } $Token = 'Token'; $TokenKey = 'TokenKey'; $fileName = "tokens.txt"; if(file_exists($fileName)){ file_put_contents($fileName, ""); } foreach($Results->children('air',true) as $nodes){ foreach($nodes->children('air',true) as $hsr){ if(strcmp($hsr->getName(),'HostTokenList') == 0){ foreach($hsr->children('common_v29_0', true) as $ht){ if(strcmp($ht->getName(), 'HostToken') == 0){ $GLOBALS[$Token] = $ht[0]; foreach($ht->attributes() as $a => $b){ if(strcmp($a, 'Key') == 0){ file_put_contents($fileName,$TokenKey.":".$b."\r\n", FILE_APPEND); } } file_put_contents($fileName,$Token.":".$ht[0]."\r\n", FILE_APPEND); } } } } } echo "\r\n"."Processing Done. Please check results in files."; } ?>