Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotel booking flow support #70

Open
DerMika opened this issue Apr 27, 2017 · 17 comments
Open

Hotel booking flow support #70

DerMika opened this issue Apr 27, 2017 · 17 comments

Comments

@DerMika
Copy link
Collaborator

DerMika commented Apr 27, 2017

Working on supporting the Amadeus Hotel booking flow:

  • Hotel_MultiSingleAvailability
  • Hotel_DescriptiveInfo
  • Hotel_EnhancedPricing
  • Hotel_Sell

Development is happening on the hotel branch.

However, there's a number of firsts here:

  • Use of separate WSDL files (Hotel "Interface" wsdl's, as Amadeus calls it) - see Support for Multiple WSDL's
  • Using the OTA XML format with attributes and complex XSD structures.
  • Requiring the use of message-specific extra classmaps in the SoapClient's construction.
@DerMika
Copy link
Collaborator Author

DerMika commented Apr 27, 2017

I'm currently stuck on a translation from PHP objects to XSD objects on the Criterion / HotelSearchCriterionType / ItemSearchCriterionType. The Criterion object seems to be recognized, but any properties that are defined in HotelSearchCriterionType or ItemSearchCriterionType do not seem to get translated into the XML message being sent out.

You can test this yourself by doing the following Hotel_MultiSingleAvailability call:

use Amadeus\Client\RequestOptions\HotelMultiSingleAvailOptions;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Criteria;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Guest;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\HotelReference;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Rates;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Room;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Segment;

$availabilityResponse = $client->hotelMultiSingleAvailability(
    new HotelMultiSingleAvailOptions([
        'segments' => [
            new Segment([
                'infoSource' => Segment::SOURCE_DISTRIBUTION,
                'criteria' => [
                    new Criteria([
                        'exactMatch' => true,
                        'stayStart' => \DateTime::createFromFormat('Y-m-d', '2017-12-28'),
                        'stayEnd' => \DateTime::createFromFormat('Y-m-d', '2017-12-29'),
                        'hotelReferences' => [
                            new HotelReference([
                                'chainCode' => 'RT',
                                'cityCode' => 'VIE',
                                'name' => 'SOFITEL VIENNA'
                            ])
                        ],
                        'rates' => [
                            new Rates([
                                'min' => 100.0,
                                'max' => 400.0,
                                'timeUnit' => Rates::TIMEUNIT_DAY
                            ])
                        ],
                        'rooms' => [
                            new Room([
                                'id' => 1,
                                'amount' => 1,
                                'guests' => [
                                    new Guest([
                                        'occupantCode' => Guest::OCCUPANT_ADULT,
                                        'amount' => 1
                                    ])
                                ]
                            ])
                        ]
                    ])
                ]
            ])
        ]
    ])
);

Currently this produces the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Soap headers & envelope omitted -->
<SOAP-ENV:Body>
	<ns1:OTA_HotelAvailRQ SummaryOnly="true" RateRangeOnly="true" RateDetailsInd="true" EchoToken="MultiSingle" Version="4.000">
		<ns1:AvailRequestSegments>
			<ns1:AvailRequestSegment InfoSource="Distribution">
				<ns1:HotelSearchCriteria AvailableOnlyIndicator="true">
					<ns1:Criterion/>
				</ns1:HotelSearchCriteria>
			</ns1:AvailRequestSegment>
		</ns1:AvailRequestSegments>
	</ns1:OTA_HotelAvailRQ>
</SOAP-ENV:Body>

Criterion is an element defined in an XSD imported in the WSDL (OTA_HotelCommonTypes.xsd) as an extension of the HotelSearchCriterionType complexType , which is an extension of the complexType ItemSearchCriterionType defined in an included OTA_CommonTypes.xsd

For some reason, the SoapClient is not recognizing the link between XSD type HotelSearchCriterionType and Amadeus\Client\Struct\Hotel\MultiSingleAvailability\HotelSearchCriterionType

To be investigated.

@saaqeb
Copy link

saaqeb commented Oct 29, 2018

Why getting this error

[29-Oct-2018 17:44:12 UTC] PHP Fatal error: Uncaught Amadeus\Client\InvalidMessageException: Message "Hotel_MultiSingleAvailability" is not in WDSL in /home/travoweb/public_html/amadeus_hoel/src/Amadeus/Client/RequestCreator/Base.php:118
Stack trace:
#0 /home/travoweb/public_html/amadeus_hoel/src/Amadeus/Client/RequestCreator/Base.php(98): Amadeus\Client\RequestCreator\Base->checkMessageIsInWsdl('Hotel_MultiSing...')
#1 /home/travoweb/public_html/amadeus_hoel/src/Amadeus/Client.php(1104): Amadeus\Client\RequestCreator\Base->createRequest('Hotel_MultiSing...', Object(Amadeus\Client\RequestOptions\HotelMultiSingleAvailOptions))
#2 /home/travoweb/public_html/amadeus_hoel/src/Amadeus/Client.php(1013): Amadeus\Client->callMessage('Hotel_MultiSing...', Object(Amadeus\Client\RequestOptions\HotelMultiSingleAvailOptions), Array)
#3 /home/travoweb/public_html/amadeus_hoel/TEST_Hotel_Data.php(68): Amadeus\Client->hotelMultiSingleAvailability(Object(Amadeus\Client\RequestOptions\HotelMultiSingleAvailOptions))
#4 {main}
thrown in /home/travoweb/public_html/amadeus_hoel/src/Amadeus/Client/RequestCreator/Base.php on line 118

@therealartz
Copy link
Collaborator

therealartz commented Oct 29, 2018

@saaqeb which WSDL file you using in Client?

@saaqeb
Copy link

saaqeb commented Oct 29, 2018

my own wsdl

@therealartz
Copy link
Collaborator

@saaqeb HotelAvailability_2.0_4.0.wsdl?

@saaqeb
Copy link

saaqeb commented Oct 29, 2018

HotelAvailability_2.0.wsdl

@saaqeb
Copy link

saaqeb commented Oct 29, 2018

[ 'officeId' => 'XXXXXX', //The Amadeus Office Id you want to sign in to - must be open on your WSAP. 'userId' => 'XXXXXX', //Also known as 'Originator' for Soap Header 1 & 2 WSDL's 'passwordData' => 'XXXXX' // **base 64 encoded** password ], 'sessionHandlerParams' => [ 'soapHeaderVersion' => Client::HEADER_V4, 'wsdl' => '/home/travoweb/public_html/amadeus_sandbox/1ASIWOTANA4_PDT_20180321_161425/HotelAvailability_2.0.wsdl', 'stateful' => true, 'logger' => new Psr\Log\NullLogger() ], 'requestCreatorParams' => [ 'receivedFrom' => 'Saaqeb Nayeem Hotel TravoJet' ] ]); $client = new Client($params); use Amadeus\Client\RequestOptions\HotelMultiSingleAvailOptions; use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Criteria; use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Guest; use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\HotelReference; use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Rates; use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Room; use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Segment; $availabilityResponse = $client->hotelMultiSingleAvailability( new HotelMultiSingleAvailOptions([ 'segments' => [ new Segment([ 'infoSource' => Segment::SOURCE_DISTRIBUTION, 'criteria' => [ new Criteria([ 'exactMatch' => true, 'stayStart' => \DateTime::createFromFormat('Y-m-d', '2018-12-28'), 'stayEnd' => \DateTime::createFromFormat('Y-m-d', '2018-12-29'), 'hotelReferences' => [ new HotelReference([ 'chainCode' => 'RT', 'cityCode' => 'VIE', 'name' => 'SOFITEL VIENNA' ]) ], 'rates' => [ new Rates([ 'min' => 100.0, 'max' => 400.0, 'timeUnit' => Rates::TIMEUNIT_DAY ]) ], 'rooms' => [ new Room([ 'id' => 1, 'amount' => 1, 'guests' => [ new Guest([ 'occupantCode' => Guest::OCCUPANT_ADULT, 'amount' => 1 ]) ] ]) ] ]) ] ]) ] ]) ); $HotelInfo = json_encode($params); $HotelInfo = json_decode($HotelInfo, true); print"
";
print_r($HotelInfo);
print"
"; exit; ?>

@therealartz
Copy link
Collaborator

So... you getting this error because message Hotel_MultiSingleAvailability are not found in your WSDL schema.

Probably you just don't have access to this web service.
Or maybe you should re-download schemas from extranet page.

Yours HotelAvailability_2.0.wsdl file should contain such tags:

<wsdl:operation name="Hotel_MultiSingleAvailability">
    <soap:operation soapAction="http://webservices.amadeus.com/Hotel_MultiSingleAvailability_10.0" />
    ...

@saaqeb
Copy link

saaqeb commented Oct 29, 2018

Now i am getting this error

`Array
(
[status] => FATAL
[messages] => Array
(
[0] => Array
(
[code] => 18
[text] =>
[level] => Application
[source] =>
)

    )

[response] => 
[responseXml] => soap:Server 18|Application|

)`

@DerMika
Copy link
Collaborator Author

DerMika commented Nov 1, 2018

Are you using the hotel implementation from the hotel branch? You should know that it is not functional. It is still a work in progress (although I no longer have the time to work on it), so expect to encounter bugs if you try to use it.

atomy pushed a commit to mlamm/amadeus-ws-client that referenced this issue Nov 26, 2018
…DS-45-amadeus-integrate-prometheus to master

* commit 'a6ebeaf23a8f981a7d28a5e3a163fa6a6ebd6c98':
  FDS-45 | (add) error that should be handled as empty response
  FDS-45 | (remove) jenkinsfile for pr pipeline as this does't work with outdated stash
  FDS-45 | (add) jenkins pr pipeline script
  FDS-45 | (add) track cache requests (hit/miss)
  FDS-45 | (add) track metrics
  FDS-45 | (add) prometheus client | (update) dependencies
@o150209001
Copy link

I'm currently stuck on a translation from PHP objects to XSD objects on the Criterion / HotelSearchCriterionType / ItemSearchCriterionType. The Criterion object seems to be recognized, but any properties that are defined in HotelSearchCriterionType or ItemSearchCriterionType do not seem to get translated into the XML message being sent out.

You can test this yourself by doing the following Hotel_MultiSingleAvailability call:

use Amadeus\Client\RequestOptions\HotelMultiSingleAvailOptions;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Criteria;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Guest;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\HotelReference;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Rates;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Room;
use Amadeus\Client\RequestOptions\Hotel\MultiSingleAvail\Segment;

$availabilityResponse = $client->hotelMultiSingleAvailability(
    new HotelMultiSingleAvailOptions([
        'segments' => [
            new Segment([
                'infoSource' => Segment::SOURCE_DISTRIBUTION,
                'criteria' => [
                    new Criteria([
                        'exactMatch' => true,
                        'stayStart' => \DateTime::createFromFormat('Y-m-d', '2017-12-28'),
                        'stayEnd' => \DateTime::createFromFormat('Y-m-d', '2017-12-29'),
                        'hotelReferences' => [
                            new HotelReference([
                                'chainCode' => 'RT',
                                'cityCode' => 'VIE',
                                'name' => 'SOFITEL VIENNA'
                            ])
                        ],
                        'rates' => [
                            new Rates([
                                'min' => 100.0,
                                'max' => 400.0,
                                'timeUnit' => Rates::TIMEUNIT_DAY
                            ])
                        ],
                        'rooms' => [
                            new Room([
                                'id' => 1,
                                'amount' => 1,
                                'guests' => [
                                    new Guest([
                                        'occupantCode' => Guest::OCCUPANT_ADULT,
                                        'amount' => 1
                                    ])
                                ]
                            ])
                        ]
                    ])
                ]
            ])
        ]
    ])
);

Currently this produces the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Soap headers & envelope omitted -->
<SOAP-ENV:Body>
	<ns1:OTA_HotelAvailRQ SummaryOnly="true" RateRangeOnly="true" RateDetailsInd="true" EchoToken="MultiSingle" Version="4.000">
		<ns1:AvailRequestSegments>
			<ns1:AvailRequestSegment InfoSource="Distribution">
				<ns1:HotelSearchCriteria AvailableOnlyIndicator="true">
					<ns1:Criterion/>
				</ns1:HotelSearchCriteria>
			</ns1:AvailRequestSegment>
		</ns1:AvailRequestSegments>
	</ns1:OTA_HotelAvailRQ>
</SOAP-ENV:Body>

Criterion is an element defined in an XSD imported in the WSDL (OTA_HotelCommonTypes.xsd) as an extension of the HotelSearchCriterionType complexType , which is an extension of the complexType ItemSearchCriterionType defined in an included OTA_CommonTypes.xsd

For some reason, the SoapClient is not recognizing the link between XSD type HotelSearchCriterionType and Amadeus\Client\Struct\Hotel\MultiSingleAvailability\HotelSearchCriterionType

To be investigated.

Hello, I also encountered the same problem when concatenating. Is there any way to solve it now?
Thanks.

@therealartz
Copy link
Collaborator

therealartz commented Sep 20, 2019

@o150209001 some guys solved this problem that way
f9bb82b#diff-d667c14c7bed52a489b12df97a37c844R132 I guess

@o150209001
Copy link

@o150209001 some guys solved this problem that way
f9bb82b#diff-d667c14c7bed52a489b12df97a37c844R132 I guess

Hello,I tried this ,but it's not working.
The problem is still the same.
Criterion element is disappear.
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.opentravel.org/OTA/2003/05" xmlns:ns2="http://www.w3.org/2005/08/addressing" xmlns:ns3="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd" xmlns:ns4="http://xml.amadeus.com/2010/06/Session_v3" xmlns:ns5="http://xml.amadeus.com/2010/06/Security_v1"> <SOAP-ENV:Body> <ns1:OTA_HotelAvailRQ SummaryOnly="true" SortOrder="N" AvailRatesOnly="true" RateRangeOnly="true" ExactMatchOnly="true" RateDetailsInd="true" EchoToken="MultiSingle" Version="4.000" MaxResponses="90"> <ns1:AvailRequestSegments> <ns1:AvailRequestSegment InfoSource="Distribution"> <ns1:HotelSearchCriteria AvailableOnlyIndicator="true" BestOnlyIndicator="true"> <ns1:Criterion/> </ns1:HotelSearchCriteria> </ns1:AvailRequestSegment> </ns1:AvailRequestSegments> </ns1:OTA_HotelAvailRQ> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

Thanks.

@alaskaenterprises
Copy link

Hello,
Whats The latest for hotels,cars SOAP API? any development? Please guide me how can i integrate these modules in my project without new authentication

@s-code
Copy link

s-code commented Mar 12, 2021

@DerMika we had also an error with empty Criterion xml node, but only in case when we used PDT files. Everything started to work with "adapted" TST wsdl files.

@stevensoe0524
Copy link

Can I have sample of how to request "Hotel_DescriptiveInfo" please?
thank you

@HariBeedev
Copy link

Can I have sample of how to request "Hotel_DescriptiveInfo" please? thank you

did you get any sample file for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants