code
stringlengths 17
247k
| docstring
stringlengths 30
30.3k
| func_name
stringlengths 1
89
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 7
153
| url
stringlengths 51
209
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public function securitySignOut()
{
$msgName = 'Security_SignOut';
return $this->callMessage(
$msgName,
new RequestOptions\SecuritySignOutOptions(),
[],
true
);
} | Terminate a session - only applicable to non-stateless mode.
@return Result
@throws Exception | securitySignOut | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $messageOptions = [])
{
$msgName = 'PNR_Retrieve';
return $this->callMessage($msgName, $options, $messageOptions);
} | PNR_Retrieve - Retrieve an Amadeus PNR by record locator
@param RequestOptions\PnrRetrieveOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | pnrRetrieve | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function pnrCreatePnr(RequestOptions\PnrCreatePnrOptions $options, $messageOptions = [])
{
$msgName = 'PNR_AddMultiElements';
return $this->callMessage($msgName, $options, $messageOptions);
} | Create a PNR using PNR_AddMultiElements
@param RequestOptions\PnrCreatePnrOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | pnrCreatePnr | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function pnrAddMultiElements(RequestOptions\PnrAddMultiElementsOptions $options, $messageOptions = [])
{
$msgName = 'PNR_AddMultiElements';
return $this->callMessage($msgName, $options, $messageOptions);
} | PNR_AddMultiElements - Create a new PNR or update an existing PNR.
https://webservices.amadeus.com/extranet/viewService.do?id=25&flavourId=1&menuId=functional
@param RequestOptions\PnrAddMultiElementsOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | pnrAddMultiElements | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function pnrRetrieveAndDisplay(RequestOptions\PnrRetrieveAndDisplayOptions $options, $messageOptions = [])
{
$msgName = 'PNR_RetrieveAndDisplay';
return $this->callMessage($msgName, $options, $messageOptions);
} | PNR_RetrieveAndDisplay - Retrieve an Amadeus PNR by record locator including extra info
This extra info is info you cannot see in the regular PNR, like Offers.
https://webservices.amadeus.com/extranet/viewService.do?id=1922&flavourId=1&menuId=functional
@param RequestOptions\PnrRetrieveAndDisplayOptions $options Amadeus Record Locator for PNR
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | pnrRetrieveAndDisplay | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function queueList(RequestOptions\QueueListOptions $options, $messageOptions = [])
{
$msgName = 'Queue_List';
return $this->callMessage($msgName, $options, $messageOptions);
} | Queue_List - get a list of all PNR's on a given queue
https://webservices.amadeus.com/extranet/viewService.do?id=52&flavourId=1&menuId=functional
@param RequestOptions\QueueListOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | queueList | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function queuePlacePnr(RequestOptions\QueuePlacePnrOptions $options, $messageOptions = [])
{
$msgName = 'Queue_PlacePNR';
return $this->callMessage($msgName, $options, $messageOptions);
} | Queue_PlacePNR - Place a PNR on a given queue
@param RequestOptions\QueuePlacePnrOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | queuePlacePnr | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function pnrIgnore(RequestOptions\PnrIgnoreOptions $options, $messageOptions = [])
{
$msgName = 'PNR_Ignore';
return $this->callMessage($msgName, $options, $messageOptions);
} | PNR_Ignore - Ignore an Amadeus PNR by record locator
@param RequestOptions\PnrIgnoreOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | pnrIgnore | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function queueRemoveItem(RequestOptions\QueueRemoveItemOptions $options, $messageOptions = [])
{
$msgName = 'Queue_RemoveItem';
return $this->callMessage($msgName, $options, $messageOptions);
} | Queue_RemoveItem - remove an item (a PNR) from a given queue
@param RequestOptions\QueueRemoveItemOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | queueRemoveItem | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function queueMoveItem(RequestOptions\QueueMoveItemOptions $options, $messageOptions = [])
{
$msgName = 'Queue_MoveItem';
return $this->callMessage($msgName, $options, $messageOptions);
} | Queue_MoveItem - move an item (a PNR) from one queue to another.
@param RequestOptions\QueueMoveItemOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | queueMoveItem | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function offerVerify(RequestOptions\OfferVerifyOptions $options, $messageOptions = [])
{
$msgName = 'Offer_VerifyOffer';
return $this->callMessage($msgName, $options, $messageOptions);
} | Offer_VerifyOffer
To be called in the context of an open PNR
@param RequestOptions\OfferVerifyOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | offerVerify | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function fareMasterPricerTravelBoardSearch(
RequestOptions\FareMasterPricerTbSearch $options,
$messageOptions = []
) {
$msgName = 'Fare_MasterPricerTravelBoardSearch';
return $this->callMessage($msgName, $options, $messageOptions);
} | Fare_MasterPricerTravelBoardSearch
@param RequestOptions\FareMasterPricerTbSearch $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | fareMasterPricerTravelBoardSearch | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function fareInformativePricingWithoutPnr(
RequestOptions\FareInformativePricingWithoutPnrOptions $options,
$messageOptions = []
) {
$msgName = 'Fare_InformativePricingWithoutPNR';
return $this->callMessage($msgName, $options, $messageOptions);
} | Fare_InformativePricingWithoutPNR
@param RequestOptions\FareInformativePricingWithoutPnrOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | fareInformativePricingWithoutPnr | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function fareInformativeBestPricingWithoutPnr(
RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options,
$messageOptions = []
) {
$msgName = 'Fare_InformativeBestPricingWithoutPNR';
return $this->callMessage($msgName, $options, $messageOptions);
} | Fare_InformativeBestPricingWithoutPNR
@param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | fareInformativeBestPricingWithoutPnr | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function ticketAtcShopperMasterPricerTravelBoardSearch(
RequestOptions\TicketAtcShopperMpTbSearchOptions $options,
$messageOptions = []
) {
$msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch';
return $this->callMessage($msgName, $options, $messageOptions);
} | Ticket_ATCShopperMasterPricerTravelBoardSearch
@param RequestOptions\TicketAtcShopperMpTbSearchOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | ticketAtcShopperMasterPricerTravelBoardSearch | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function ticketAtcShopperMasterPricerCalendar(
RequestOptions\TicketAtcShopperMpCalendarOptions $options,
$messageOptions = []
) {
$msgName = 'Ticket_ATCShopperMasterPricerCalendar';
return $this->callMessage($msgName, $options, $messageOptions);
} | Ticket_ATCShopperMasterPricerCalendar
@param RequestOptions\TicketAtcShopperMpCalendarOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | ticketAtcShopperMasterPricerCalendar | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function ticketRepricePnrWithBookingClass(
RequestOptions\TicketRepricePnrWithBookingClassOptions $options,
$messageOptions = []
) {
$msgName = 'Ticket_RepricePNRWithBookingClass';
return $this->callMessage($msgName, $options, $messageOptions);
} | Ticket_RepricePNRWithBookingClass
@param RequestOptions\TicketRepricePnrWithBookingClassOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | ticketRepricePnrWithBookingClass | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function ticketReissueConfirmedPricing(
RequestOptions\TicketReissueConfirmedPricingOptions $options,
$messageOptions = []
) {
$msgName = 'Ticket_ReissueConfirmedPricing';
return $this->callMessage($msgName, $options, $messageOptions);
} | Ticket_ReissueConfirmedPricing
@param RequestOptions\TicketReissueConfirmedPricingOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | ticketReissueConfirmedPricing | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function docIssuanceIssueMiscellaneousDocuments(
RequestOptions\DocIssuanceIssueMiscDocOptions $options,
$messageOptions = []
) {
$msgName = 'DocIssuance_IssueMiscellaneousDocuments';
return $this->callMessage($msgName, $options, $messageOptions);
} | DocIssuance_IssueMiscellaneousDocuments
@param RequestOptions\DocIssuanceIssueMiscDocOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | docIssuanceIssueMiscellaneousDocuments | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function salesReportsDisplayQueryReport(
RequestOptions\SalesReportsDisplayQueryReportOptions $options,
$messageOptions = []
) {
$msgName = 'SalesReports_DisplayQueryReport';
return $this->callMessage($msgName, $options, $messageOptions);
} | SalesReports_DisplayQueryReport
@param RequestOptions\SalesReportsDisplayQueryReportOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | salesReportsDisplayQueryReport | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function salesReportsDisplayDailyOrSummarizedReport(
RequestOptions\SalesReportsDisplayDailyOrSummarizedReportOptions $options,
$messageOptions = []
) {
$msgName = 'SalesReports_DisplayDailyOrSummarizedReport';
return $this->callMessage($msgName, $options, $messageOptions);
} | SalesReports_DisplayorSummarizedReport
@param RequestOptions\SalesReportsDisplayDailyOrSummarizedReportOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | salesReportsDisplayDailyOrSummarizedReport | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function salesReportsDisplayNetRemitReport(
RequestOptions\SalesReportsDisplayNetRemitReportOptions $options,
$messageOptions = []
) {
$msgName = 'SalesReports_DisplayNetRemitReport';
return $this->callMessage($msgName, $options, $messageOptions);
} | SalesReports_DisplayNetRemitReport
@param RequestOptions\SalesReportsDisplayNetRemitReportOptions $options
@param array $messageOptions (OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | salesReportsDisplayNetRemitReport | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function serviceStandaloneCatalogue(
RequestOptions\ServiceStandaloneCatalogueOptions $options,
$messageOptions = [],
) {
$msgName = 'Service_StandaloneCatalogue';
return $this->callMessage($msgName, $options, $messageOptions);
} | Service_StandaloneCatalogue
@param RequestOptions\ServiceStandaloneCatalogueOptions $options
@param array $messageOptions
(OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | serviceStandaloneCatalogue | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function travelOrderRetrieve(RequestOptions\TravelOrderRetrieveOptions $options, $messageOptions = [])
{
$msgName = 'Travel_OrderRetrieve';
return $this->callMessage($msgName, $options, $messageOptions);
} | Travel_OrderRetrieve
@param RequestOptions\TravelOrderRetrieveOptions $options
@param array $messageOptions
(OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | travelOrderRetrieve | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function travelSeatAvailability(RequestOptions\TravelSeatAvailabilityOptions $options, $messageOptions = [])
{
$msgName = 'Travel_SeatAvailability';
return $this->callMessage($msgName, $options, $messageOptions);
} | Travel_SeatAvailability
@param RequestOptions\TravelSeatAvailabilityOptions $options
@param array $messageOptions
(OPTIONAL)
@return Result
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws Exception | travelSeatAvailability | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
protected function callMessage($messageName, $options, $messageOptions, $endSession = false)
{
$messageOptions = $this->makeMessageOptions($messageOptions, $endSession);
$this->lastMessage = $messageName;
$sendResult = $this->sessionHandler->sendMessage(
$messageName,
$this->requestCreator->createRequest(
$messageName,
$options
),
$messageOptions
);
$response = $this->responseHandler->analyzeResponse(
$sendResult,
$messageName
);
if ($messageOptions['returnXml'] === false) {
$response->responseXml = null;
}
return $response;
} | Call a message with the given parameters
@param string $messageName
@param RequestOptions\RequestOptionsInterface $options
@param array $messageOptions
@param bool $endSession
@return Result
@throws Client\Exception
@throws Client\Struct\InvalidArgumentException
@throws Client\InvalidMessageException
@throws Client\RequestCreator\MessageVersionUnsupportedException
@throws \RuntimeException
@throws \InvalidArgumentException | callMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
protected function makeMessageOptions(array $incoming, $endSession = false)
{
$options = [
'endSession' => $endSession,
'returnXml' => $this->returnResultXml
];
if (array_key_exists('endSession', $incoming)) {
$options['endSession'] = $incoming['endSession'];
}
if (array_key_exists('returnXml', $incoming)) {
$options['returnXml'] = $incoming['returnXml'];
}
return $options;
} | Make message options
Message options are meta options when sending a message to the amadeus web services
- 'endSession' (if stateful) : should we end the current session after sending this call?
- 'returnXml' : Should we return the XML string in the Result::responseXml property?
(this overrides the default setting returnXml in the Amadeus\Client\Params for a single message)
@param array $incoming The Message options chosen by the caller - if any.
@param bool $endSession Switch if you want to terminate the current session after making the call.
@return array | makeMessageOptions | php | amabnl/amadeus-ws-client | src/Amadeus/Client.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client.php | Apache-2.0 |
public function setStatus($newStatus)
{
if ($this->isWorseStatus($newStatus, $this->status)) {
$this->status = $newStatus;
}
} | Sets error status.
Will not override a more severe status.
@param string $newStatus | setStatus | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Result.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Result.php | Apache-2.0 |
protected function isWorseStatus($newStatus, $currentStatus)
{
$levels = [
self::STATUS_UNKNOWN => -1,
self::STATUS_OK => 0,
self::STATUS_INFO => 2,
self::STATUS_WARN => 5,
self::STATUS_ERROR => 10,
self::STATUS_FATAL => 20,
];
return ($currentStatus === null || $levels[$newStatus] > $levels[$currentStatus]);
} | Checks if new status is worse than current status
@param string $newStatus
@param string $currentStatus
@return bool true if newStatus is worse than old status. | isWorseStatus | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Result.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Result.php | Apache-2.0 |
protected function loadSessionHandler($sessionHandler, $params)
{
if ($sessionHandler instanceof HandlerInterface) {
$newSessionHandler = $sessionHandler;
} else {
$newSessionHandler = HandlerFactory::createHandler($params);
}
return $newSessionHandler;
} | Load the session handler
Either load the provided session handler or create one depending on incoming parameters.
@param HandlerInterface|null $sessionHandler
@param Params\SessionHandlerParams|null $params
@return HandlerInterface | loadSessionHandler | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Base.php | Apache-2.0 |
protected function loadRequestCreator($requestCreator, $params, $libIdentifier, $originatorOffice, $mesVer)
{
if ($requestCreator instanceof RequestCreatorInterface) {
$newRequestCreator = $requestCreator;
} else {
$params->originatorOfficeId = $originatorOffice;
$params->messagesAndVersions = $mesVer;
$newRequestCreator = RequestCreatorFactory::createRequestCreator(
$params,
$libIdentifier
);
}
return $newRequestCreator;
} | Load a request creator
A request creator is responsible for generating the correct request to send.
@param RequestCreatorInterface|null $requestCreator
@param Params\RequestCreatorParams $params
@param string $libIdentifier Library identifier & version string (for Received From)
@param string $originatorOffice The Office we are signed in with.
@param array $mesVer Messages & Versions array of active messages in the WSDL
@return RequestCreatorInterface
@throws \RuntimeException | loadRequestCreator | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Base.php | Apache-2.0 |
public function __doRequest($request, $location, $action, $version, $oneWay = null)
{
if (!extension_loaded('xsl')) {
throw new Exception('PHP XSL extension is not enabled.');
}
$newRequest = $this->transformIncomingRequest($request);
return parent::__doRequest($newRequest, $location, $action, $version, $oneWay);
} | __doRequest override of SoapClient
@param string $request The XML SOAP request.
@param string $location The URL to request.
@param string $action The SOAP action.
@param int $version The SOAP version.
@param int|null $oneWay
@uses parent::__doRequest
@return string The XML SOAP response.
@throws Exception When PHP XSL extension is not enabled or WSDL file isn't readable. | __doRequest | php | amabnl/amadeus-ws-client | src/Amadeus/Client/SoapClient.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/SoapClient.php | Apache-2.0 |
public function __construct($params = [])
{
foreach ($params as $propName => $propValue) {
if (property_exists($this, $propName)) {
$this->$propName = $propValue;
//TODO support for objects that must be instantiated???
}
}
} | Construct Request Options object with initialization array
@param array $params Initialization parameters | __construct | php | amabnl/amadeus-ws-client | src/Amadeus/Client/LoadParamsFromArray.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/LoadParamsFromArray.php | Apache-2.0 |
protected function loadFromArray(array $params)
{
if (isset($params['returnXml']) && is_bool($params['returnXml'])) {
$this->returnXml = $params['returnXml'];
}
$this->loadRequestCreator($params);
$this->loadSessionHandler($params);
$this->loadResponseHandler($params);
$this->loadAuthParams($params);
$this->loadSessionHandlerParams($params);
$this->loadRequestCreatorParams($params);
} | Load parameters from an associative array
@param array $params
@return void | loadFromArray | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Params.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Params.php | Apache-2.0 |
public function __construct($params = [])
{
foreach ($params as $propName => $propValue) {
if (property_exists($this, $propName)) {
$this->$propName = $propValue;
}
}
} | Construct Queue with initialization array
@param array $params Initialization parameters | __construct | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestOptions/Queue.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestOptions/Queue.php | Apache-2.0 |
public function __construct(AuthParams $authParams = null)
{
if ($authParams instanceof AuthParams) {
$this->loadFromAuthParams($authParams);
}
parent::__construct([]);
} | SecurityAuthenticateOptions constructor.
@param AuthParams|null $authParams | __construct | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestOptions/SecurityAuthenticateOptions.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestOptions/SecurityAuthenticateOptions.php | Apache-2.0 |
protected function loadFromAuthParams(AuthParams $authParams)
{
$this->officeId = $authParams->officeId;
$this->dutyCode = $authParams->dutyCode;
$this->organizationId = $authParams->organizationId;
$this->originatorTypeCode = $authParams->originatorTypeCode;
$this->userId = $authParams->userId;
$this->passwordLength = $authParams->passwordLength;
$this->passwordData = $authParams->passwordData;
} | Load security authenticate options from auth params
@param AuthParams $authParams | loadFromAuthParams | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestOptions/SecurityAuthenticateOptions.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestOptions/SecurityAuthenticateOptions.php | Apache-2.0 |
public function analyzeResponse($sendResult, $messageName)
{
if (!empty($sendResult->exception)) {
return $this->makeResultForException($sendResult);
}
$handler = $this->findHandlerForMessage($messageName);
if ($handler instanceof MessageResponseHandler) {
return $handler->analyze($sendResult);
} else {
return new Result($sendResult, Result::STATUS_UNKNOWN);
}
} | Analyze the response from the server and throw an exception when an error has been detected.
@param SendResult $sendResult The Send Result from the Session Handler
@param string $messageName The message that was called
@throws Exception
@throws \RuntimeException
@return Result | analyzeResponse | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/Base.php | Apache-2.0 |
private function findHandlerForMessage($messageName)
{
$handler = null;
if (array_key_exists($messageName, $this->responseHandlers) &&
$this->responseHandlers[$messageName] instanceof MessageResponseHandler
) {
$handler = $this->responseHandlers[$messageName];
} else {
$section = substr($messageName, 0, strpos($messageName, '_'));
$message = substr($messageName, strpos($messageName, '_') + 1);
$handlerClass = __NAMESPACE__.'\\'.$section.'\\Handler'.$message;
if (class_exists($handlerClass)) {
/** @var MessageResponseHandler $handler */
$handler = new $handlerClass();
$this->responseHandlers[$messageName] = $handler;
}
}
return $handler;
} | Find or create the correct handler object for a given message
@param string $messageName
@return MessageResponseHandler|null | findHandlerForMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/Base.php | Apache-2.0 |
protected function analyzeWithErrCodeCategoryMsgQuery(SendResult $response, $qErr, $qCat, $qMsg, $errLevel = null)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
$errorCodeNodeList = $domXpath->query($qErr);
if ($errorCodeNodeList->length > 0) {
$analyzeResponse->status = Result::STATUS_ERROR;
$errorCatNode = $domXpath->query($qCat)->item(0);
if ($errorCatNode instanceof \DOMNode) {
$analyzeResponse->status = $this->makeStatusFromErrorQualifier($errorCatNode->nodeValue);
}
$analyzeResponse->messages[] = new Result\NotOk(
$errorCodeNodeList->item(0)->nodeValue,
$this->makeMessageFromMessagesNodeList(
$domXpath->query($qMsg)
),
$errLevel
);
}
return $analyzeResponse;
} | Analyze response by looking for error, category and message with the provided XPATH queries
xpath queries must be prefixed with the namespace self::XMLNS_PREFIX
@param SendResult $response
@param string $qErr XPATH query for fetching error code (first node is used)
@param string $qCat XPATH query for fetching error category (first node is used)
@param string $qMsg XPATH query for fetching error messages (all nodes are used)
@param string|null $errLevel Optional custom error level string.
@return Result | analyzeWithErrCodeCategoryMsgQuery | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
protected function analyzeWithErrorCodeMsgQueryLevel(SendResult $response, $qErr, $qMsg, $qLvl, $lvlToText)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
$errorCodeNodeList = $domXpath->query($qErr);
if ($errorCodeNodeList->length > 0) {
$analyzeResponse->status = Result::STATUS_ERROR;
$lvlNodeList = $domXpath->query($qLvl);
$level = null;
if ($lvlNodeList->length > 0) {
if (array_key_exists($lvlNodeList->item(0)->nodeValue, $lvlToText)) {
$level = $lvlToText[$lvlNodeList->item(0)->nodeValue];
}
}
$analyzeResponse->messages[] = new Result\NotOk(
$errorCodeNodeList->item(0)->nodeValue,
$this->makeMessageFromMessagesNodeList(
$domXpath->query($qMsg)
),
$level
);
}
return $analyzeResponse;
} | Analyze response by looking for error, message and level with the provided XPATH queries
Result status defaults to Result::STATUS_ERROR if any error is found.
xpath queries must be prefixed with the namespace self::XMLNS_PREFIX
@param SendResult $response
@param string $qErr XPATH query for fetching error code (first node is used)
@param string $qMsg XPATH query for fetching error messages (all nodes are used)
@param string $qLvl XPATH query for fetching error level (first node is used)
@param array $lvlToText Level-to-text translation
@return Result | analyzeWithErrorCodeMsgQueryLevel | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
public function analyzeWithErrCodeAndMsgQueryFixedCat(SendResult $response, $qErr, $qMsg, $category)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
$errorCodeNodeList = $domXpath->query($qErr);
$errorMsgNodeList = $domXpath->query($qMsg);
if ($errorCodeNodeList->length > 0 || $errorMsgNodeList->length > 0) {
$analyzeResponse->status = $category;
$errorCode = ($errorCodeNodeList->length > 0) ? $errorCodeNodeList->item(0)->nodeValue : null;
$analyzeResponse->messages[] = new Result\NotOk(
$errorCode,
$this->makeMessageFromMessagesNodeList($errorMsgNodeList)
);
}
return $analyzeResponse;
} | Analyse with XPATH queries for error code and message, provide fixed category
@param SendResult $response
@param string $qErr XPATH query for fetching error code (first node is used)
@param string $qMsg XPATH query for fetching error messages (all nodes are used)
@param string $category Result::STATUS_* The fixed error category (status)
@return Result | analyzeWithErrCodeAndMsgQueryFixedCat | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
protected function analyzeWithErrCodeCategoryMsgNodeName(SendResult $response, $nodeErr, $nodeCat, $nodeMsg)
{
$analyzeResponse = new Result($response);
$domDoc = $this->loadDomDocument($response->responseXml);
$errorCodeNode = $domDoc->getElementsByTagName($nodeErr)->item(0);
if (!is_null($errorCodeNode)) {
$errorCatNode = $domDoc->getElementsByTagName($nodeCat)->item(0);
if ($errorCatNode instanceof \DOMNode) {
$analyzeResponse->status = $this->makeStatusFromErrorQualifier($errorCatNode->nodeValue);
} else {
$analyzeResponse->status = Result::STATUS_ERROR;
}
$errorCode = $errorCodeNode->nodeValue;
$errorTextNodeList = $domDoc->getElementsByTagName($nodeMsg);
$analyzeResponse->messages[] = new Result\NotOk(
$errorCode,
$this->makeMessageFromMessagesNodeList($errorTextNodeList)
);
}
return $analyzeResponse;
} | Analyze response by looking for error, category and message in nodes specified by name
@param SendResult $response
@param string $nodeErr Node name of the node containing the error code (first node is used)
@param string $nodeCat Node name of the node containing the error category (first node is used)
@param string $nodeMsg Node name of the node containing the error messages (all nodes are used)
@return Result | analyzeWithErrCodeCategoryMsgNodeName | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
protected function makeDomXpath($response)
{
$domDoc = $this->loadDomDocument($response);
$domXpath = new \DOMXPath($domDoc);
$domXpath->registerNamespace(
self::XMLNS_PREFIX,
$domDoc->documentElement->lookupNamespaceUri(null)
);
return $domXpath;
} | Make a Xpath-queryable object for an XML string
registers TNS namespace with prefix self::XMLNS_PREFIX
@param string $response
@return \DOMXPath
@throws Exception when there's a problem loading the message | makeDomXpath | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
protected function makeStatusFromErrorQualifier($qualifier, $defaultStatus = Result::STATUS_ERROR)
{
$statusQualMapping = [
'INF' => Result::STATUS_INFO,
'WEC' => Result::STATUS_WARN,
'WZZ' => Result::STATUS_WARN, //Mutually defined warning
'WA' => Result::STATUS_WARN, //Info line Warning - PNR_AddMultiElements
'W' => Result::STATUS_WARN,
'EC' => Result::STATUS_ERROR,
'ERR' => Result::STATUS_ERROR, //DocRefund_UpdateRefund
'ERC' => Result::STATUS_ERROR, //DocRefund_UpdateRefund
'X' => Result::STATUS_ERROR,
'001' => Result::STATUS_ERROR, //Air_MultiAvailability
'O' => Result::STATUS_OK,
'STA' => Result::STATUS_OK,
'ZZZ' => Result::STATUS_UNKNOWN
];
if (array_key_exists($qualifier, $statusQualMapping)) {
$status = $statusQualMapping[$qualifier];
} elseif (is_null($qualifier)) {
$status = $defaultStatus;
} else {
$status = Result::STATUS_UNKNOWN;
}
return $status;
} | Converts a status code found in an error message to the appropriate status level
if no node found (= $qualifier is a null), $defaultStatus will be used
@param string|null $qualifier
@param string $defaultStatus the default status to fall back to if no qualifier is present
@return string Result::STATUS_* | makeStatusFromErrorQualifier | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
protected function makeMessageFromMessagesNodeList($errorTextNodeList)
{
return implode(
' - ',
array_map(
function ($item) {
return trim($item->nodeValue);
},
iterator_to_array($errorTextNodeList)
)
);
} | Convert a DomNodeList of nodes containing a (potentially partial) error message into a string.
@param \DOMNodeList $errorTextNodeList
@return string|null | makeMessageFromMessagesNodeList | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php | Apache-2.0 |
protected function getErrorTextFromQueueErrorCode($errorCode)
{
$recognizedErrors = [
'1' => 'Invalid date',
'360' => 'Invalid PNR file address',
'723' => 'Invalid category',
'727' => 'Invalid amount',
'79A' => 'Invalid office identification',
'79B' => 'Already working another queue',
'79C' => 'Not allowed to access queues for specified office identification',
'79D' => 'Queue identifier has not been assigned for specified office identification',
'79E' => 'Attempting to perform a queue function when not associated with a queue',
'79F' => 'Queue placement or add new queue item is not allowed for the specified office and queue',
'911' => 'Unable to process - system error',
'912' => 'Incomplete message - data missing in query',
'913' => 'Item/data not found or data not existing in processing host',
'914' => 'Invalid format/data - data does not match EDIFACT rules',
'915' => 'No action - processing host cannot support function',
'916' => 'EDIFACT version not supported',
'917' => 'EDIFACT message size exceeded',
'918' => 'Enter message in remarks',
'919' => 'No PNR in AAA',
'91A' => 'Inactive queue bank',
'91B' => 'Nickname not found',
'91C' => 'Invalid record locator',
'91D' => 'Invalid format',
'91F' => 'Invalid queue number',
'920' => 'Queue/date range empty',
'921' => 'Target not specified',
'922' => 'Targetted queue has wrong queue type',
'923' => 'Invalid time',
'924' => 'Invalid date range',
'925' => 'Queue number not specified',
'926' => 'Queue category empty',
'927' => 'No items exist',
'928' => 'Queue category not assigned',
'929' => 'No more items',
'92A' => '>ueue category full'
];
$errorMessage = (array_key_exists($errorCode, $recognizedErrors)) ? $recognizedErrors[$errorCode] : '';
if ($errorMessage === '') {
$errorMessage = "QUEUE ERROR '".$errorCode."' (Error message unavailable)";
}
return $errorMessage;
} | Returns the errortext from a Queue_*Reply errorcode
This function is necessary because the core only responds
with errorcode but does not send an errortext.
The errorcodes for all Queue_*Reply messages are the same.
@link https://webservices.amadeus.com/extranet/viewArea.do?id=10
@param string $errorCode
@return string the errortext for this errorcode. | getErrorTextFromQueueErrorCode | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/Queue/HandlerList.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/Queue/HandlerList.php | Apache-2.0 |
public static function findMessage($code)
{
$message = null;
if (array_key_exists($code, self::$errorList)) {
$message = self::$errorList[$code];
}
return $message;
} | Find the error message for a given error code
@param string $code
@return string|null | findMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/Air/HandlerRetrieveSeatMap.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/Air/HandlerRetrieveSeatMap.php | Apache-2.0 |
public static function decodeProcessingLevel($level)
{
$decoded = null;
$map = [
0 => 'system',
1 => 'application'
];
if (array_key_exists($level, $map)) {
$decoded = $map[$level];
}
return $decoded;
} | Decode error processing level code
@param int|string $level
@return string|null | decodeProcessingLevel | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/Air/HandlerRetrieveSeatMap.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/Air/HandlerRetrieveSeatMap.php | Apache-2.0 |
public function analyze(SendResult $response)
{
return $this->analyzeSimpleResponseErrorCodeAndMessage($response);
} | Analysing a PNR_TransferOwnershipReply
@param SendResult $response
@return Result | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/PNR/HandlerTransferOwnership.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/PNR/HandlerTransferOwnership.php | Apache-2.0 |
public function analyze(SendResult $response)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
$queryAllErrorCodes = "//m:generalErrorGroup//m:errorNumber/m:errorDetails/m:errorCode";
$queryAllErrorMsg = "//m:generalErrorGroup/m:genrealErrorText/m:freeText";
$errorCodeNodeList = $domXpath->query($queryAllErrorCodes);
if ($errorCodeNodeList->length > 0) {
$analyzeResponse->status = Result::STATUS_ERROR;
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query($queryAllErrorMsg);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message));
}
return $analyzeResponse;
} | Analysing a PNR_DisplayHistoryReply
@param SendResult $response
@return Result | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/PNR/HandlerDisplayHistory.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/PNR/HandlerDisplayHistory.php | Apache-2.0 |
public function analyze(SendResult $response)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
$qPassErrors = "//m:passengerErrorInEnhancedData//m:errorDetails/m:errorCode";
$qPassErrorCat = "//m:passengerErrorInEnhancedData//m:errorDetails/m:errorCategory";
$qPassErrorMsg = "//m:passengerErrorInEnhancedData//m:freeText";
$errorCodeNodeList = $domXpath->query($qPassErrors);
if ($errorCodeNodeList->length > 0) {
$analyzeResponse->status = Result::STATUS_ERROR;
$errorCatNode = $domXpath->query($qPassErrorCat)->item(0);
if ($errorCatNode instanceof \DOMNode) {
$analyzeResponse->status = $this->makeStatusFromErrorQualifier($errorCatNode->nodeValue);
}
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query($qPassErrorMsg);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'passenger');
}
if (empty($analyzeResponse->messages) && $analyzeResponse->status === Result::STATUS_OK) {
$analyzeResponse = $this->analyzeSimpleResponseErrorCodeAndMessage($response);
}
return $analyzeResponse;
} | Analysing a PNR_NameChangeReply
@param SendResult $response
@return Result | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/PNR/HandlerNameChange.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/PNR/HandlerNameChange.php | Apache-2.0 |
protected function getErrorTextFromQueueErrorCode($errorCode)
{
$recognizedErrors = [
'1' => 'Invalid date',
'107' => 'Invalid Airline Designator/Vendor Supplier',
'109' => 'Invalid Country Code',
'111' => 'Invalid Agent\'s Code',
'112' => 'Requestor Identification Required',
'113' => 'Invalid Period of Operation',
'114' => 'Invalid Flight Number',
'115' => 'Invalid Arrival Date',
'116' => 'Invalid Arrival Time',
'118' => 'System Unable to Process',
'12' => 'Invalid product details qualifier coded',
'120' => 'Invalid Action Code',
'129' => 'No PNR Match Found',
'130' => 'Invalid Origin and Destination Pair',
'134' => 'Advise Times Different from Booked',
'135' => 'Advise Dates Different from Booked',
'136' => 'Advise Class Different from Booked',
'144' => 'Invalid Requestor Identification',
'149' => 'Surname too Long',
'151' => 'Surname Mandatory',
'152' => 'Given Name/Title Mandatory',
'153' => 'Name Mismatch',
'154' => 'Message Function Invalid',
'155' => 'Message Function Not Supported',
'156' => 'Business Function Invalid',
'157' => 'Business Function Not Supported',
'159' => 'Phone Field Required',
'18' => 'Invalid on-time performance indicator',
'19' => 'Invalid type of call at port coded',
'190' => 'Invalid Processing Indicator',
'191' => 'Name Reference Required',
'192' => 'Name Reference Inhibited',
'193' => 'Segment Reference Required',
'194' => 'Segment Reference Inhibited',
'2' => 'Invalid time',
'20' => 'Invalid government action coded',
'21' => 'Invalid facility type coded',
'22' => 'Invalid traffic restriction coded',
'23' => 'Invalid traffic restriction type coded',
'24' => 'Invalid traffic restriction qualifier coded',
'244' => 'Not allowed on marketing flights',
'245' => 'Please request on operating carrier',
'25' => 'Invalid transport stage qualifier coded',
'259' => 'Invalid Combination of Generic Codes',
'260' => 'Invalid Frequent Traveler Number',
'266' => 'Limited Recline Seat has been Reserved',
'267' => 'Name in the Request Does Not Match Name in Reservation',
'268' => 'Need Names, Passenger Name Information Required to Reserve Seats',
'269' => 'Indicates that Additional Data for this Message Reference Number follows',
'288' => 'Unable to Satisfy, Need Confirmed Flight Status',
'289' => 'Unable to Retrieve PNR, Database Error',
'294' => 'Invalid Format',
'295' => 'No Flights Requested',
'3' => 'Invalid transfer sequence',
'301' => 'Application Suspended',
'302' => 'Invalid Length',
'304' => 'System Temporarily Unavailable',
'305' => 'Security/Audit Failure',
'306' => 'Invalid Language Code',
'307' => 'Received from data missing',
'308' => 'Received from data invalid',
'309' => 'Received from data missing or invalid',
'310' => 'Ticket arrangement data missing',
'311' => 'Ticket arrangement data invalid',
'312' => 'Ticket arrangement data missing or invalid',
'320' => 'Invalid segment status',
'321' => 'Duplicate flight segment',
'325' => 'Related system reference error',
'326' => 'Sending system reference error',
'327' => 'Invalid segment data in itinerary',
'328' => 'Invalid aircraft registration',
'329' => 'Invalid hold version',
'330' => 'invalid loading type',
'331' => 'Invalid ULD type',
'332' => 'Invalid serial number',
'333' => 'Invalid contour/height code',
'334' => 'Invalid tare weight',
'335' => 'Unit code unknown',
'336' => 'Invalid category code',
'337' => 'Invalid special load reference',
'338' => 'Invalid weight status',
'347' => 'Incompatible loads',
'348' => 'Invalid flight status',
'349' => 'Invalid application/product identification',
'352' => 'Link to inventory system is unavailable',
'354' => 'Invalid product status',
'356' => 'Query control tables full',
'357' => 'Declined to process interactively-default to backup',
'360' => 'Invalid PNR file address',
'361' => 'PNR is secured',
'362' => 'Unable to display PNR and/or name list',
'363' => 'PNR too long',
'364' => 'Invalid ticket number',
'365' => 'Invalid responding system in-house code',
'366' => 'Name list too long',
'367' => 'No active itinerary',
'368' => 'Not authorized',
'369' => 'No PNR is active, redisplay PNR required',
'370' => 'Simultaneous changes to PNR',
'371' => 'Prior PNR display required',
'375' => 'Requestor not authorized for this function for this PNR',
'381' => 'Record locator required',
'382' => 'PNR status value not equal',
'383' => 'Invalid change to status code',
'384' => 'Multiple Name Matches',
'385' => 'Mutually exclusive optional parameters',
'386' => 'Invalid minimum/maximum connect time specified',
'390' => 'Unable to reformat',
'391' => 'PNR contains non air segments',
'392' => 'Invalid block type/name',
'393' => 'Block sell restricted-request block name change',
'394' => 'Segment not valid for electronic ticketing',
'395' => 'Already ticketed',
'396' => 'Invalid ticket/coupon status',
'397' => 'Maximum ticket limit reached',
'399' => 'Duplicate Name',
'4' => 'Invalid city/airport code',
'400' => 'Duplicate ticket number',
'401' => 'Ticket number not found',
'403' => 'Requested Data Not Sorted',
'408' => 'No More Data Available',
'414' => 'Need Prior Availability Request',
'415' => 'Need Prior Schedule Request',
'416' => 'Need Prior Timetable Request',
'417' => 'Repeat Request Updating in Progress',
'437' => 'Carrier must be in separate PNR',
'438' => 'Request is outside system date range for this carrier within this system',
'440' => 'Void request on already voided or printed coupons',
'441' => 'Invalid Priority Number',
'442' => 'System in control of device is unknown',
'443' => 'Device address is unknown',
'445' => 'Security indicator requires originator ID',
'448' => 'Contact Service Provider directly',
'450' => 'All electronic ticket coupons have been printed',
'451' => 'Only individual seat request allowed at this time',
'457' => 'Unable-Connection Market Unavailable',
'459' => 'Owner Equal to Requestor',
'462' => 'Invalid authorization number',
'463' => 'Authorization number already used',
'466' => 'Form of payment missing or invalid for electronic ticketing',
'472' => 'Account does not allow redemption',
'473' => 'No award inventory available for requested market and date',
'5' => 'Invalid time mode',
'6' => 'Invalid operational suffix',
'7' => 'Invalid period of schedule validity',
'705' => 'Invalid or missing Coupon/Booklet Number',
'706' => 'Invalid Certificate Number',
'708' => 'Incorrect credit card information',
'709' => 'Invalid and/or missing frequent traveler information',
'70D' => 'Display criteria not supported',
'710' => 'Free text qualifier error',
'711' => 'Invalid Fare Calculation Status Code',
'712' => 'Missing and/or invalid monetary information',
'713' => 'Invalid Price Type Qualifier',
'716' => 'Missing and/or invalid reservation control information',
'717' => 'Missing and/or invalid travel agent and/or system identification',
'718' => 'Invalid Document Type',
'721' => 'Too much data',
'723' => 'Invalid category',
'724' => 'Invalid routing',
'725' => 'Domestic itinerary',
'726' => 'Invalid global indicator',
'727' => 'Invalid amount',
'728' => 'Invalid conversion type',
'729' => 'Invalid currency code',
'738' => 'Overflow',
'743' => 'Electronic ticket record purposely not accessable',
'745' => 'Refund (full or partial) not allowed',
'746' => 'Open segment(s) not permitted for first coupon or entire itinerary',
'747' => 'Validity date(s) required for electronic tickets',
'748' => 'Status change denied',
'749' => 'Coupon status not open',
'750' => 'Endorsement restriction',
'754' => 'Electronic ticket outside validity date',
'755' => 'Invalid exchange/coupon media',
'757' => 'Exchange paper to electronic ticket not allowed',
'760' => 'Conjunction ticket numbers are not sequential',
'761' => 'Exchange/Reissue must include all unused coupons',
'762' => 'Invalid tax amount',
'763' => 'Invalid tax code',
'766' => 'Ticket has no residual value',
'767' => 'Historical data not available - unable to process',
'790' => 'Exchange denied - no further exchanges allowed',
'791' => 'Unable to void exchanged/reissued ticket',
'792' => 'Segment not eligible for interline electronic ticket',
'793' => 'Fare/tax amount too long',
'794' => 'Invalid or missing fare calculation',
'795' => 'Invalid, missing or conflicting search criteria',
'796' => 'Partial void of ticket coupons not allowed',
'797' => 'Invalid stopover indicator',
'798' => 'Invalid stopover code usage',
'799' => 'Electronic ticket exists, no match on specified criteria',
'79A' => 'Invalid office identification',
'8' => 'Invalid days of operation',
'9' => 'Invalid frequency rate',
'900' => 'Inactivity Time Out Value Exceeded',
'901' => 'Communications Line Unavailable',
'902' => 'Prior message being processed or already processed',
'911' => 'Unable to process - system error',
'912' => 'Incomplete message - data missing in query',
'913' => 'Item/data not found or data not existing in processing host',
'914' => 'Invalid format/data - data does not match EDIFACT rules',
'915' => 'No action - processing host cannot support function',
'916' => 'EDIFACT version not supported',
'917' => 'EDIFACT message size exceeded',
];
$errorMessage = (array_key_exists($errorCode, $recognizedErrors)) ? $recognizedErrors[$errorCode] : '';
if ($errorMessage === '') {
$errorMessage = "PROCESS E-TICKET ERROR '" . $errorCode . "' (Error message unavailable)";
}
return $errorMessage;
} | Returns the errortext from a Ticket_ProcessETicketReply errorcode
This function is necessary because the core only responds
with errorcode but does not send an errortext.
The errorcodes for all Queue_*Ticket_ProcessETicketReply messages are the same.
@param string $errorCode
@return string the errortext for this errorcode. | getErrorTextFromQueueErrorCode | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/Ticket/HandlerList.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/Ticket/HandlerList.php | Apache-2.0 |
public function analyze(SendResult $response)
{
//Actually, any error in this call is a SOAPFAULT.
return $this->analyzeSimpleResponseErrorCodeAndMessage($response);
} | Any response you'll ever get with this message is either a SOAPFAULT or a success.
@param SendResult $response
@return Result | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/PointOfRef/HandlerSearch.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/PointOfRef/HandlerSearch.php | Apache-2.0 |
public function analyze(SendResult $response)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
//General error level in the transmissionError location:
$errorCodeNodeList = $domXpath->query(self::Q_G_ERR);
if ($errorCodeNodeList->length > 0) {
$errorCatNode = $domXpath->query(self::Q_G_CAT)->item(0);
$analyzeResponse->setStatus($this->makeStatusForPotentiallyNonExistent($errorCatNode));
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query(self::Q_G_MSG);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'general');
}
//FP level errors via the fopDescription/fpElementError data:
$errorCodeNodeList = $domXpath->query(self::Q_F_ERR);
if ($errorCodeNodeList->length > 0) {
$errorCatNode = $domXpath->query(self::Q_F_CAT)->item(0);
$analyzeResponse->setStatus($this->makeStatusForPotentiallyNonExistent($errorCatNode));
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query(self::Q_F_MSG);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'fp');
}
//Deficient FOP level errors:
$errorCodeNodeList = $domXpath->query(self::Q_D_ERR);
if ($errorCodeNodeList->length > 0) {
$errorCatNode = $domXpath->query(self::Q_D_CAT)->item(0);
$analyzeResponse->setStatus($this->makeStatusForPotentiallyNonExistent($errorCatNode));
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query(self::Q_D_MSG);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'deficient_fop');
}
//authorization failure:
$errorCodeNodeList = $domXpath->query(self::Q_A_ERR);
if ($errorCodeNodeList->length > 0) {
$errorCatNode = $domXpath->query(self::Q_A_CAT)->item(0);
$analyzeResponse->setStatus($this->makeStatusForPotentiallyNonExistent($errorCatNode));
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query(self::Q_A_MSG);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'authorization_failure');
}
return $analyzeResponse;
} | FOP_CreateFormOfPayment Analyze the result from the message operation and check for any error messages
@param SendResult $response
@return Result
@throws Exception | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/FOP/HandlerCreateFormOfPayment.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/FOP/HandlerCreateFormOfPayment.php | Apache-2.0 |
protected function makeStatusForPotentiallyNonExistent($errorCatNode)
{
if ($errorCatNode instanceof \DOMNode) {
$status = $this->makeStatusFromErrorQualifier($errorCatNode->nodeValue);
} else {
$status = Result::STATUS_ERROR;
}
return $status;
} | Make status from a category DOMNode or default status.
@param \DOMNode|null $errorCatNode
@return string | makeStatusForPotentiallyNonExistent | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/FOP/HandlerCreateFormOfPayment.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/FOP/HandlerCreateFormOfPayment.php | Apache-2.0 |
public function analyze(SendResult $response)
{
$analyzeResponse = new Result($response);
$domXpath = $this->makeDomXpath($response->responseXml);
//General error level in the transmissionError location:
$errorCodeNodeList = $domXpath->query(self::Q_G_ERR);
if ($errorCodeNodeList->length > 0) {
$errorCatNode = $domXpath->query(self::Q_G_CAT)->item(0);
$analyzeResponse->setStatus($this->makeStatusForPotentiallyNonExistent($errorCatNode));
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query(self::Q_G_MSG);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'general');
}
//Deficient FOP level errors:
$errorCodeNodeList = $domXpath->query(self::Q_D_ERR);
if ($errorCodeNodeList->length > 0) {
$errorCatNode = $domXpath->query(self::Q_D_CAT)->item(0);
$analyzeResponse->setStatus($this->makeStatusForPotentiallyNonExistent($errorCatNode));
$code = $errorCodeNodeList->item(0)->nodeValue;
$errorTextNodeList = $domXpath->query(self::Q_D_MSG);
$message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
$analyzeResponse->messages[] = new Result\NotOk($code, trim($message), 'deficient_fop');
}
return $analyzeResponse;
} | FOP_ValidateFormOfPayment Analyze the result from the message operation and check for any error messages
@param SendResult $response
@return Result
@throws Exception | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/FOP/HandlerValidateFOP.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/FOP/HandlerValidateFOP.php | Apache-2.0 |
public function analyze(SendResult $response)
{
$analyzeResponse = new Result($response);
$code = null;
$message = null;
$domXpath = $this->makeDomXpath($response->responseXml);
$categoryNodes = $domXpath->query('//ama_ct:Errors/ama_ct:Error/@Type');
if ($categoryNodes->length > 0) {
$analyzeResponse->status = $this->makeStatusFromErrorQualifier($categoryNodes->item(0)->nodeValue);
}
$codeNodes = $domXpath->query('//ama_ct:Errors/ama_ct:Error/@Code');
if ($codeNodes->length > 0) {
$code = $codeNodes->item(0)->nodeValue;
}
$messageNodes = $domXpath->query('//ama_ct:Errors/ama_ct:Error/@ShortText');
if ($messageNodes->length > 0) {
$message = $this->makeMessageFromMessagesNodeList($messageNodes);
}
if (!is_null($message) && !is_null($code)) {
$analyzeResponse->messages[] = new Result\NotOk($code, $message);
}
return $analyzeResponse;
} | Analyze the result from the message operation and check for any error messages
@param SendResult $response
@return Result
@throws Exception | analyze | php | amabnl/amadeus-ws-client | src/Amadeus/Client/ResponseHandler/PAY/HandlerListVirtualCards.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/ResponseHandler/PAY/HandlerListVirtualCards.php | Apache-2.0 |
public function __construct(RequestCreatorParams $params)
{
$this->params = $params;
$this->messagesAndVersions = $params->messagesAndVersions;
} | Base Request Creator constructor.
@param RequestCreatorParams $params | __construct | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestCreator/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestCreator/Base.php | Apache-2.0 |
public function createRequest($messageName, RequestOptionsInterface $params)
{
$this->checkMessageIsInWsdl($messageName);
$builder = $this->findBuilderForMessage($messageName);
if ($builder instanceof ConvertInterface) {
return $builder->convert($params, $this->getActiveVersionFor($messageName));
} else {
throw new \RuntimeException('No builder found for message '.$messageName);
}
} | Create a request message for a given message with a set of options.
@param string $messageName the message name as named in the WSDL
@param RequestOptionsInterface $params
@throws Struct\InvalidArgumentException When invalid input is detected during message creation.
@throws InvalidMessageException when trying to create a request for a message that is not in your WSDL.
@return mixed the created request | createRequest | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestCreator/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestCreator/Base.php | Apache-2.0 |
protected function checkMessageIsInWsdl($messageName)
{
if (!array_key_exists($messageName, $this->messagesAndVersions)) {
throw new InvalidMessageException('Message "'.$messageName.'" is not in WDSL');
}
} | Check if a given message is in the active WSDL(s). Throws exception if it isn't.
@throws InvalidMessageException if message is not in loaded WSDL(s).
@param string $messageName | checkMessageIsInWsdl | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestCreator/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestCreator/Base.php | Apache-2.0 |
protected function getActiveVersionFor($messageName)
{
$found = null;
if (isset($this->messagesAndVersions[$messageName]) &&
isset($this->messagesAndVersions[$messageName]['version'])
) {
$found = $this->messagesAndVersions[$messageName]['version'];
}
return $found;
} | Get the version number active in the WSDL for the given message
@param string $messageName
@return float|string|null | getActiveVersionFor | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestCreator/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestCreator/Base.php | Apache-2.0 |
protected function findBuilderForMessage($messageName)
{
$builder = null;
if (array_key_exists($messageName, $this->messageBuilders) &&
$this->messageBuilders[$messageName] instanceof ConvertInterface
) {
$builder = $this->messageBuilders[$messageName];
} else {
$section = substr($messageName, 0, strpos($messageName, '_'));
$message = substr($messageName, strpos($messageName, '_') + 1);
$builderClass = __NAMESPACE__.'\\Converter\\'.$section.'\\'.$message."Conv";
if (class_exists($builderClass)) {
/** @var ConvertInterface $builder */
$builder = new $builderClass();
$builder->setParams($this->params);
$this->messageBuilders[$messageName] = $builder;
}
}
return $builder;
} | Find the correct builder for a given message
Builder classes implement the ConvertInterface and are used to build only one kind of message.
The standard converter class is
__NAMESPACE__ \ Converter \ Sectionname \ Messagename + "Conv"
e.g.
Amadeus\Client\RequestCreator\Converter\DocIssuance\IssueTicketConv
@param string $messageName
@return ConvertInterface|null | findBuilderForMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client/RequestCreator/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/RequestCreator/Base.php | Apache-2.0 |
public function extract($soapResponse)
{
$messageBody = null;
$messageBody = $this->getStringBetween($soapResponse, '<SOAP-ENV:Body>', '</SOAP-ENV:Body>');
if (empty($messageBody) || false === $messageBody) {
$messageBody = $this->getStringBetween($soapResponse, '<soap:Body>', '</soap:Body>');
}
return $messageBody;
} | Extracts the message content from the soap envelope (i.e. everything under the soap body)
@param string $soapResponse
@return string|null | extract | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Util/MsgBodyExtractor.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Util/MsgBodyExtractor.php | Apache-2.0 |
private function getStringBetween($string, $start, $end)
{
$startPos = strpos($string, $start) + strlen($start);
$endPos = strlen($string) - strpos($string, $end);
return substr($string, $startPos, -$endPos);
} | Get substring between two strings
@param $string
@param $start
@param $end
@return bool|string | getStringBetween | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Util/MsgBodyExtractor.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Util/MsgBodyExtractor.php | Apache-2.0 |
public static function generateSomewhatRandomString($length = 22)
{
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
mt_srand((int)microtime(true) * 1000000);
$i = 0;
$somewhatRandom = '';
while ($i < $length) {
$num = rand() % 60;
$tmp = substr($chars, $num, 1);
$somewhatRandom = $somewhatRandom.$tmp;
$i++;
}
return $somewhatRandom;
} | Generates a somewhat random string of a given length
@param int $length
@return string | generateSomewhatRandomString | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Util/SomewhatRandomGenerator.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Util/SomewhatRandomGenerator.php | Apache-2.0 |
protected static function loadNonceBase($handlerParams)
{
if (empty($handlerParams->authParams->nonceBase)) {
$handlerParams->authParams->nonceBase = SomewhatRandomGenerator::generateSomewhatRandomString();
}
return $handlerParams;
} | Get the NONCE base to be used when generating somewhat random nonce strings
From the NONCE base file, or fallback is a new somewhat random string each instantiation.
@param SessionHandlerParams $handlerParams
@return SessionHandlerParams | loadNonceBase | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/HandlerFactory.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/HandlerFactory.php | Apache-2.0 |
protected function prepareForNextMessage($messageName, $messageOptions)
{
if (!$this->isAuthenticated && $messageName !== 'Security_Authenticate') {
throw new InvalidSessionException('No active session');
}
$this->getSoapClient($messageName)->__setSoapHeaders(null);
if ($this->isAuthenticated === true && is_int($this->sessionData['sequenceNumber'])) {
$this->sessionData['sequenceNumber']++;
$session = new Client\Struct\HeaderV2\Session(
$this->sessionData['sessionId'],
$this->sessionData['sequenceNumber'],
$this->sessionData['securityToken']
);
$this->getSoapClient($messageName)->__setSoapHeaders(
new \SoapHeader(self::CORE_WS_V2_SESSION_NS, self::NODENAME_SESSION, $session)
);
}
} | Prepare to send a next message and checks if authenticated
@param string $messageName
@param array $messageOptions
@throws InvalidSessionException When trying to send a message without session. | prepareForNextMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
protected function handlePostMessage($messageName, $lastResponse, $messageOptions, $result)
{
if ($messageName === "Security_Authenticate") {
$this->sessionData = $this->getSessionDataFromHeader($lastResponse);
$this->isAuthenticated = (!empty($this->sessionData['sessionId']) &&
!empty($this->sessionData['sequenceNumber']) &&
!empty($this->sessionData['securityToken']));
}
} | Handles post message actions
Handles session state based on received response
@param string $messageName
@param string $lastResponse
@param array $messageOptions
@param mixed $result | handlePostMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
public function setStateful($stateful)
{
if ($stateful === false) {
throw new UnsupportedOperationException('Stateful messages are mandatory on SoapHeader 2');
}
} | Cannot set stateless on Soap Header v2
@param bool $stateful
@throws UnsupportedOperationException | setStateful | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
public function isStateful()
{
return true;
} | Soap Header 2 sessions are always stateful
@return bool | isStateful | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
public function isTransactionFlowLinkEnabled()
{
return false; //Not supported
} | Is the TransactionFlowLink header enabled?
@return bool | isTransactionFlowLinkEnabled | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
public function setTransactionFlowLink($enabled)
{
if ($enabled === true) {
throw new UnsupportedOperationException('TransactionFlowLink header is not supported on SoapHeader 2');
}
} | Enable or disable TransactionFlowLink header
@throws UnsupportedOperationException when used on unsupported WSAP versions
@param bool $enabled | setTransactionFlowLink | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
public function getConsumerId()
{
return null; //Not supported
} | Get the TransactionFlowLink Consumer ID
@return string|null | getConsumerId | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
public function setConsumerId($id)
{
if (!is_null($id)) {
throw new UnsupportedOperationException('TransactionFlowLink header is not supported on SoapHeader 2');
}
} | Set the TransactionFlowLink Consumer ID
@throws UnsupportedOperationException when used on unsupported WSAP versions
@param string $id
@return void | setConsumerId | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
protected function makeSoapClientOptions()
{
$options = $this->soapClientOptions;
$options['classmap'] = array_merge(Classmap::$soapheader2map, Classmap::$map);
if (!empty($this->params->soapClientOptions)) {
$options = array_merge($options, $this->params->soapClientOptions);
}
return $options;
} | Make SoapClient options for Soap Header 2 handler
@return array | makeSoapClientOptions | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader2.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader2.php | Apache-2.0 |
protected static function getMessagesAndVersionsFromImportedWsdl($import, $wsdlPath, $wsdlIdentifier)
{
$msgAndVer = [];
$domXpath = null;
$importPath = realpath(dirname($wsdlPath)).DIRECTORY_SEPARATOR.$import;
try {
$wsdlContent = file_get_contents($importPath);
} catch (\Throwable) {
// swallow to throw exception below
$wsdlContent = false;
}
if ($wsdlContent !== false) {
$domDoc = new \DOMDocument('1.0', 'UTF-8');
$ok = $domDoc->loadXML($wsdlContent);
if ($ok === true) {
$domXpath = new \DOMXPath($domDoc);
$domXpath->registerNamespace(
'wsdl',
'http://schemas.xmlsoap.org/wsdl/'
);
$domXpath->registerNamespace(
'soap',
'http://schemas.xmlsoap.org/wsdl/soap/'
);
}
} else {
throw new InvalidWsdlFileException('WSDL '.$importPath.' import could not be loaded');
}
if ($domXpath instanceof \DOMXPath) {
$nodeList = $domXpath->query(self::XPATH_ALL_OPERATIONS);
$msgAndVer = array_merge(
$msgAndVer,
self::loopOperationsWithQuery(
$nodeList,
self::XPATH_ALT_VERSION_FOR_OPERATION,
$wsdlIdentifier,
$domXpath
)
);
}
return $msgAndVer;
} | Get Messages & Versions from an imported WSDL file
Imported wsdl's are a little different, they require a different query
to extract the version nrs.
@param string $import
@param string $wsdlPath
@param string $wsdlIdentifier
@return array
@throws InvalidWsdlFileException when the WSDL import could not be loaded. | getMessagesAndVersionsFromImportedWsdl | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | Apache-2.0 |
public static function loadWsdlXpath($wsdlFilePath, $wsdlId)
{
if (!isset(self::$wsdlDomXpath[$wsdlId]) || is_null(self::$wsdlDomXpath[$wsdlId])) {
try {
$wsdlContent = file_get_contents($wsdlFilePath);
} catch (\Throwable) {
// swallow to throw exception below
$wsdlContent = false;
}
if ($wsdlContent !== false) {
self::$wsdlDomDoc[$wsdlId] = new \DOMDocument('1.0', 'UTF-8');
self::$wsdlDomDoc[$wsdlId]->loadXML($wsdlContent);
self::$wsdlDomXpath[$wsdlId] = new \DOMXPath(self::$wsdlDomDoc[$wsdlId]);
self::$wsdlDomXpath[$wsdlId]->registerNamespace(
'wsdl',
'http://schemas.xmlsoap.org/wsdl/'
);
self::$wsdlDomXpath[$wsdlId]->registerNamespace(
'soap',
'http://schemas.xmlsoap.org/wsdl/soap/'
);
} else {
throw new InvalidWsdlFileException('WSDL '.$wsdlFilePath.' could not be loaded');
}
}
} | Load the WSDL contents to a queryable DOMXpath.
@param string $wsdlFilePath
@param string $wsdlId
@uses $this->wsdlDomDoc
@uses $this->wsdlDomXpath
@throws InvalidWsdlFileException when WSDL cannot be found. | loadWsdlXpath | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | Apache-2.0 |
protected static function extractMessageVersion($fullVersionString)
{
$marker = strpos($fullVersionString, '_', strpos($fullVersionString, '_') + 1);
$num = substr($fullVersionString, $marker + 1);
return str_replace('_', '.', $num);
} | extractMessageVersion
extracts "4.1" from a string like "Security_SignOut_4_1"
or "1.00" from a string like "tns:AMA_MediaGetMediaRQ_1.000"
@param string $fullVersionString
@return string | extractMessageVersion | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | Apache-2.0 |
protected static function makeWsdlIdentifier($wsdlPath)
{
return sprintf('%x', crc32($wsdlPath));
} | Generates a unique identifier for a wsdl based on its path.
@param string $wsdlPath
@return string | makeWsdlIdentifier | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | Apache-2.0 |
public static function exaluateXpathQueryOnWsdl($wsdlId, $wsdlFilePath, $xpath)
{
WsdlAnalyser::loadWsdlXpath($wsdlFilePath, $wsdlId);
return self::$wsdlDomXpath[$wsdlId]->evaluate($xpath);
} | Evaluate an XPATH query on a given WSDL
@param string $wsdlId
@param string $wsdlFilePath
@param string $xpath XPATH query
@return string|null | exaluateXpathQueryOnWsdl | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | Apache-2.0 |
protected static function loopOperationsWithQuery($operations, $query, $wsdlIdentifier, $domXpath)
{
$msgAndVer = [];
foreach ($operations as $operation) {
if (!empty($operation->value)) {
$fullVersion = $domXpath->evaluate(
sprintf($query, $operation->value)
);
if (!empty($fullVersion)) {
$extractedVersion = self::extractMessageVersion($fullVersion);
$msgAndVer[$operation->value] = [
'version' => $extractedVersion,
'wsdl' => $wsdlIdentifier
];
}
}
}
return $msgAndVer;
} | Loop all extracted operations from a wsdl and find their message versions
@param \DOMNodeList $operations
@param string $query
@param string $wsdlIdentifier
@param \DOMXPath $domXpath
@return array | loopOperationsWithQuery | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/WsdlAnalyser.php | Apache-2.0 |
public function getSessionData()
{
return $this->sessionData;
} | Get the session parameters of the active session
@return array|null | getSessionData | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function setSessionData(array $sessionData)
{
if (isset($sessionData['sessionId'], $sessionData['sequenceNumber'], $sessionData['securityToken'])) {
$this->sessionData['sessionId'] = $sessionData['sessionId'];
$this->sessionData['sequenceNumber'] = $sessionData['sequenceNumber'];
$this->sessionData['securityToken'] = $sessionData['securityToken'];
$this->isAuthenticated = true;
} else {
$this->isAuthenticated = false;
}
return $this->isAuthenticated;
} | Set the session data to continue a previously started session.
@param array $sessionData
@return bool | setSessionData | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function getLastRequest($msgName)
{
return $this->executeMethodOnSoapClientForMsg(
$msgName,
'__getLastRequest'
);
} | Get the last raw XML message that was sent out
@param string $msgName
@return string|null | getLastRequest | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function getLastResponse($msgName)
{
return $this->executeMethodOnSoapClientForMsg(
$msgName,
'__getLastResponse'
);
} | Get the last raw XML message that was received
@param string $msgName
@return string|null | getLastResponse | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function getLastRequestHeaders($msgName)
{
return $this->executeMethodOnSoapClientForMsg(
$msgName,
'__getLastRequestHeaders'
);
} | Get the request headers for the last SOAP message that was sent out
@param string $msgName
@return string|null | getLastRequestHeaders | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function getLastResponseHeaders($msgName)
{
return $this->executeMethodOnSoapClientForMsg(
$msgName,
'__getLastResponseHeaders'
);
} | Get the response headers for the last SOAP message that was received
@param string $msgName
@return string|null | getLastResponseHeaders | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function getOriginatorOffice()
{
return $this->params->authParams->officeId;
} | Get the office that we are using to sign in to.
@return string | getOriginatorOffice | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function getMessagesAndVersions()
{
if (empty($this->messagesAndVersions)) {
$this->messagesAndVersions = WsdlAnalyser::loadMessagesAndVersions($this->params->wsdl);
}
return $this->messagesAndVersions;
} | Extract the Messages and versions from the loaded WSDL file.
Result is an associative array: keys are message names, values are versions.
@return array | getMessagesAndVersions | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
protected function getActiveVersionFor($messageName)
{
$msgAndVer = $this->getMessagesAndVersions();
$found = null;
if (isset($msgAndVer[$messageName]) && isset($msgAndVer[$messageName]['version'])) {
$found = $msgAndVer[$messageName]['version'];
}
return $found;
} | Get the version number active in the WSDL for the given message
@param $messageName
@return float|string|null | getActiveVersionFor | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
protected function getWsdlIdFor($messageName)
{
$msgAndVer = $this->getMessagesAndVersions();
if (isset($msgAndVer[$messageName]) && isset($msgAndVer[$messageName]['wsdl'])) {
return $msgAndVer[$messageName]['wsdl'];
}
return null;
} | Get the WSDL ID for the given message
@param $messageName
@return string|null | getWsdlIdFor | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
protected function getSoapClient($msgName)
{
$wsdlId = $this->getWsdlIdFor($msgName);
if (!empty($msgName)) {
if (!isset($this->soapClients[$wsdlId]) || !($this->soapClients[$wsdlId] instanceof \SoapClient)) {
$this->soapClients[$wsdlId] = $this->initSoapClient($wsdlId);
}
return $this->soapClients[$wsdlId];
} else {
return null;
}
} | Get the appropriate SoapClient for a given message
(depends on which WSDL the message is defined in)
@param string $msgName
@return \SoapClient | getSoapClient | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
protected function initSoapClient($wsdlId)
{
// d($wsdlId);
$wsdlPath = WsdlAnalyser::$wsdlIds[$wsdlId];
$client = new Client\SoapClient(
$wsdlPath,
$this->makeSoapClientOptions(),
$this->params->logger
);
return $client;
} | Initialize SoapClient for a given WSDL ID
@param string $wsdlId
@return \SoapClient | initSoapClient | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
protected function executeMethodOnSoapClientForMsg($msgName, $method)
{
$result = null;
$soapClient = $this->getSoapClient($msgName);
if ($soapClient instanceof \SoapClient) {
$result = $soapClient->$method();
}
return $result;
} | Execute a method on the native SoapClient
@param string $msgName
@param string $method
@return null|string | executeMethodOnSoapClientForMsg | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/Base.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/Base.php | Apache-2.0 |
public function isStateful()
{
return $this->isStateful;
} | Check whether we are running in stateful mode (true) or in stateless mode (false)
@return bool | isStateful | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader4.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader4.php | Apache-2.0 |
public function setTransactionFlowLink($enabled)
{
$this->enableTransactionFlowLink = $enabled;
} | Enable or disable TransactionFlowLink header
@param bool $enabled | setTransactionFlowLink | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader4.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader4.php | Apache-2.0 |
public function getConsumerId($generate = false)
{
if (is_null($this->consumerId) && $generate) {
$this->consumerId = $this->generateGuid();
}
return $this->consumerId;
} | Get the TransactionFlowLink Consumer ID
@param bool $generate Whether to generate a consumer ID
@return string|null | getConsumerId | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader4.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader4.php | Apache-2.0 |
public function setConsumerId($id)
{
$this->consumerId = $id;
} | Set the TransactionFlowLink Consumer ID
@param string $id
@return void | setConsumerId | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader4.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader4.php | Apache-2.0 |
protected function prepareForNextMessage($messageName, $messageOptions)
{
if ($this->isAuthenticated === true && is_int($this->sessionData['sequenceNumber'])) {
$this->sessionData['sequenceNumber']++;
}
$headers = $this->createSoapHeaders($this->sessionData, $this->params, $messageName, $messageOptions);
$this->getSoapClient($messageName)->__setSoapHeaders(null);
$this->getSoapClient($messageName)->__setSoapHeaders($headers);
} | Handles authentication & sessions
If authenticated, increment sequence number for next message and set session info to soapheader
If not, set auth info to soapheader
@uses $this->isAuthenticated
@uses $this->sessionData
@param string $messageName
@param array $messageOptions | prepareForNextMessage | php | amabnl/amadeus-ws-client | src/Amadeus/Client/Session/Handler/SoapHeader4.php | https://github.com/amabnl/amadeus-ws-client/blob/master/src/Amadeus/Client/Session/Handler/SoapHeader4.php | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.