CODE - UC SEG STATUS NOT ALLOWED-0003 when requesting EnhancedAirBookRQ
I have to check your code, One thing is that if you getting your result from postman .. Then there is a good option for getting curl code from the postman. By click on code > change HTTP option to PHP curl >copy to clipboard . If you try with this way of write code, you have to change little changes.
And one more thing, A very good answer have given here UC status . UC status related to UN-CONFIRMED status. Please have a look here. Thanks
This is an example , for how to pass your post field data in xml form :
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_PORT => "", CURLOPT_URL => "url here", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body> soap body part </soap:Body>\n</soap:Envelope>", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", "content-type: text/xml" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
I have tried you code and modified some part of it. please try using below code
<?php header('Content-Type: application/xml'); $xmldata='<?xml version="1.0" encoding="utf-8"?> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header> <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader"> <eb:From> <eb:PartyId eb:type="urn:x12.org.IO5:01">info@gandakiintl.com</eb:PartyId> </eb:From> <eb:To> <eb:PartyId eb:type="urn:x12.org.IO5:01">webservices.sabre.com</eb:PartyId> </eb:To> <eb:ConversationId>111@gandakiintl.com</eb:ConversationId> <eb:Service eb:type="SabreXML">Enhanced Air Book Request</eb:Service> <eb:Action>EnhancedAirBookRQ</eb:Action> <eb:CPAID>T198</eb:CPAID> <eb:MessageData> <eb:MessageId>mid:11110info@gandakiintl.com</eb:MessageId> <eb:Timestamp>2016-10-17T05-27-10Z</eb:Timestamp> <eb:TimeToLive>2016-10-17T05-27-10Z</eb:TimeToLive> </eb:MessageData> </eb:MessageHeader> <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> <wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTD!ICESMSLB\/CRT.LB!-3322625022286234335!532307!0</wsse:BinarySecurityToken> </wsse:Security> </soap-env:Header> <soap-env:Body> <EnhancedAirBookRQ xmlns="http://services.sabre.com/sp/eab/v3_6" version="3.6.0" HaltOnError="true"> <OTA_AirBookRQ> <HaltOnStatus Code="UC"/> <HaltOnStatus Code="LL"/> <HaltOnStatus Code="UL"/> <HaltOnStatus Code="UN"/> <HaltOnStatus Code="NO"/> <HaltOnStatus Code="HL"/> <OriginDestinationInformation> <FlightSegment NumberInParty="1" Status="NN" FlightNumber="281" ResBookDesigCode="W" DepartureDateTime="2017-04-13T13:10:00" ArrivalDateTime="2017-04-13T14:40:00"> <DestinationLocation LocationCode="DEL"/> <Equipment AirEquipType="73H"/> <MarketingAirline FlightNumber="281" Code="9W"/> <OriginLocation LocationCode="KTM"/> </FlightSegment> </OriginDestinationInformation> </OTA_AirBookRQ> <OTA_AirPriceRQ> <PriceRequestInformation Retain="true"> <OptionalQualifiers> <FlightQualifiers> <VendorPrefs> <Airline Code="9W"/> </VendorPrefs> </FlightQualifiers> <PricingQualifiers CurrencyCode="NPR"> <PassengerType Code="ADT" Force="true" Quantity="1"/> <Taxes> <TaxExempt Code="NQ"/> </Taxes> </PricingQualifiers> </OptionalQualifiers> </PriceRequestInformation> </OTA_AirPriceRQ> <PostProcessing IgnoreAfter="false"> <RedisplayReservation/> </PostProcessing> <PreProcessing IgnoreBefore="false"> </PreProcessing> </EnhancedAirBookRQ> </soap-env:Body> </soap-env:Envelope>'; error_reporting(E_ALL); $wsdl = 'https://sws3-crt.cert.sabre.com'; $header = array( "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: \"\"", "Content-length: " . strlen($xmldata), ); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $wsdl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_POSTFIELDS, $xmldata); // the SOAP request curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $err = curl_error($ch); print_r($response); print_r($err); ?>
UC status means that the itinerary you booked is not available. It could be due to a number of different things like date, class of service, etc.
Where did you get the itinerary information from? If you're using a shopping service, I'd advise you to run it again and see if the same itinerary is still returned, or if the class of service changed.