amadeus-ws-client: Not getting a session

Hello, thank you for this very helpful library.

I need help on farePricePnrWithBookingClass with this error : { code: '1383', text: 'PNR NOT PRESENT', level: null }

I’m currently doing :

  • fareMasterPricerTravelBoardSearch (Stateless)
  • airSellFromRecommendation
  • pnrAddMultiElements (ACTION_END_TRANSACT_RETRIEVE)
  • farePricePnrWithBookingClass

Also tried it on pnrRetrieve and I am having the same error. I am certain that I am on stateful when I’m sending this messages. I even checked it using isStateful() and it is returning true. Reading through posted issues here that has same problem with me makes me understand that when I’m on stateful I should have a session details but when I checked it using getSessionData() it will give me

{ sessionId: null, sequenceNumber: null, securityToken: null }

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Exactly.

Each time you instantiate Amadeus\Client, it will be initialized without session context. Before your Client object gets destroyed, you MUST extract session information from it to persist and use again, or it’ll be lost.

Take a look at this “dirty” example: https://github.com/amabnl/amadeus-ws-client/issues/240#issuecomment-428490653 Here are correct using of Client instance and also “caching” of session data.

PNR REQUEST

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://xml.amadeus.com/PNRADD_16_1_1A" 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:Header>
	<ns2:MessageID>1374976F-9934-CCAD-F137-E9626EB1C19B</ns2:MessageID>
	<ns2:Action>http://webservices.amadeus.com/PNRADD_16_1_1A</ns2:Action>
	<ns2:To>https://nodeD2.test.webservices.amadeus.com/1ASIWCTYLVV</ns2:To>
	<oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 	
		<oas:UsernameToken xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" oas1:Id="UsernameToken-1"> 		
			<oas:Username>XXX</oas:Username> 		
			<oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXX</oas:Nonce> 	
			<oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">XXX</oas:Password> 	
			<oas1:Created>2018-10-26T02:56:22:893Z</oas1:Created> 
		</oas:UsernameToken> 
	</oas:Security>
	<ns4:Session TransactionStatusCode="Start">
		<ns4:SessionId/><ns4:SequenceNumber/><ns4:SecurityToken/>
	</ns4:Session>
	<ns5:AMA_SecurityHostedUser>
		<ns5:UserID POS_Type="1" PseudoCityCode="CGYPH2116" AgentDutyCode="SU" RequestorType="U"/>
	</ns5:AMA_SecurityHostedUser>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
	<ns1:PNR_AddMultiElements>
		<ns1:pnrActions>
			<ns1:optionCode>11</ns1:optionCode>
		</ns1:pnrActions>
		<ns1:travellerInfo>
			<ns1:elementManagementPassenger>
				<ns1:reference>
					<ns1:qualifier>PR</ns1:qualifier>
					<ns1:number>1</ns1:number>
				</ns1:reference>
				<ns1:segmentName>NM</ns1:segmentName>
			</ns1:elementManagementPassenger>
			<ns1:passengerData>
				<ns1:travellerInformation>
					<ns1:traveller>
						<ns1:surname>Soriano</ns1:surname>
					</ns1:traveller>
					<ns1:passenger>
						<ns1:firstName>Lou Ard MR</ns1:firstName>
						<ns1:type>ADT</ns1:type></ns1:passenger>
					</ns1:travellerInformation>
				</ns1:passengerData>
			</ns1:travellerInfo>
			<ns1:originDestinationDetails>
				<ns1:originDestination>
					<ns1:origin>HKG</ns1:origin>
					<ns1:destination>MNL</ns1:destination>
				</ns1:originDestination>
				<ns1:itineraryInfo>
					<ns1:elementManagementItinerary>
						<ns1:reference>
							<ns1:qualifier>OT</ns1:qualifier>
							<ns1:number>1</ns1:number>
						</ns1:reference>
						<ns1:segmentName>AIR</ns1:segmentName>
					</ns1:elementManagementItinerary>
					<ns1:airAuxItinerary>
						<ns1:travelProduct>
							<ns1:product>
								<ns1:depDate>271018</ns1:depDate>
							</ns1:product>
							<ns1:boardpointDetail>
								<ns1:cityCode>HKG</ns1:cityCode>
							</ns1:boardpointDetail>
							<ns1:offpointDetail>
								<ns1:cityCode>MNL</ns1:cityCode>
							</ns1:offpointDetail>
							<ns1:company>
								<ns1:identification>PR</ns1:identification>
							</ns1:company>
							<ns1:productDetails>
								<ns1:identification>313</ns1:identification>
								<ns1:classOfService>M</ns1:classOfService>
							</ns1:productDetails>
						</ns1:travelProduct>
						<ns1:messageAction>
							<ns1:business>
								<ns1:function>1</ns1:function>
							</ns1:business>
						</ns1:messageAction>
						<ns1:relatedProduct>
							<ns1:quantity>1</ns1:quantity>
							<ns1:status>NN</ns1:status>
						</ns1:relatedProduct>
						<ns1:selectionDetailsAir>
							<ns1:selection>
								<ns1:option>0</ns1:option>
							</ns1:selection>
						</ns1:selectionDetailsAir>
					</ns1:airAuxItinerary>
				</ns1:itineraryInfo>
			</ns1:originDestinationDetails>
			<ns1:dataElementsMaster>
				<ns1:marker1/>
				<ns1:dataElementsIndiv>
					<ns1:elementManagementData>
						<ns1:reference>
							<ns1:qualifier>OT</ns1:qualifier>
							<ns1:number>2</ns1:number>
						</ns1:reference>
						<ns1:segmentName>AP</ns1:segmentName>
					</ns1:elementManagementData>
					<ns1:freetextData>
						<ns1:freetextDetail>
							<ns1:subjectQualifier>3</ns1:subjectQualifier>
							<ns1:type>5</ns1:type>
						</ns1:freetextDetail>
					</ns1:freetextData>
				</ns1:dataElementsIndiv>
				<ns1:dataElementsIndiv>
					<ns1:elementManagementData>
						<ns1:reference>
							<ns1:qualifier>OT</ns1:qualifier>
							<ns1:number>3</ns1:number>
						</ns1:reference>
						<ns1:segmentName>AP</ns1:segmentName>
					</ns1:elementManagementData>
					<ns1:freetextData>
						<ns1:freetextDetail>
							<ns1:subjectQualifier>3</ns1:subjectQualifier>
							<ns1:type>7</ns1:type>
						</ns1:freetextDetail>
						<ns1:longFreetext>09123213213</ns1:longFreetext>
					</ns1:freetextData>
					<ns1:referenceForDataElement>
						<ns1:reference>
							<ns1:qualifier>PR</ns1:qualifier>
							<ns1:number>1</ns1:number>
						</ns1:reference>
					</ns1:referenceForDataElement>
				</ns1:dataElementsIndiv>
				<ns1:dataElementsIndiv>
					<ns1:elementManagementData>
						<ns1:reference>
							<ns1:qualifier>OT</ns1:qualifier>
							<ns1:number>4</ns1:number>
						</ns1:reference>
						<ns1:segmentName>TK</ns1:segmentName>
					</ns1:elementManagementData>
					<ns1:ticketElement>
						<ns1:passengerType>PAX</ns1:passengerType>
						<ns1:ticket>
							<ns1:indicator>OK</ns1:indicator>
						</ns1:ticket>
					</ns1:ticketElement>
				</ns1:dataElementsIndiv>
				<ns1:dataElementsIndiv>
					<ns1:elementManagementData>
						<ns1:reference>
							<ns1:qualifier>OT</ns1:qualifier>
							<ns1:number>6</ns1:number>
						</ns1:reference>
						<ns1:segmentName>RF</ns1:segmentName>
					</ns1:elementManagementData>
					<ns1:freetextData>
						<ns1:freetextDetail>
							<ns1:subjectQualifier>3</ns1:subjectQualifier>
							<ns1:type>P22</ns1:type>
						</ns1:freetextDetail>
						<ns1:longFreetext>Lou Ard Soriano</ns1:longFreetext>
					</ns1:freetextData>
				</ns1:dataElementsIndiv>
			</ns1:dataElementsMaster>
		</ns1:PNR_AddMultiElements>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

PNR RESPONSE

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:awsse="http://xml.amadeus.com/2010/06/Session_v3" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<SOAP-ENV:Header>
	<wsa:To>http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
	<wsa:From>
		<wsa:Address>https://nodeD2.test.webservices.amadeus.com/XXX</wsa:Address>
	</wsa:From>
	<wsa:Action>http://webservices.amadeus.com/PNRADD_16_1_1A</wsa:Action>
	<wsa:MessageID>urn:uuid:2f5debec-c4ad-3b04-65b8-2570b0fc96cf</wsa:MessageID>
	<wsa:RelatesTo RelationshipType="http://www.w3.org/2005/08/addressing/reply">1374976F-9934-CCAD-F137-E9626EB1C19B</wsa:RelatesTo>
	<awsse:Session TransactionStatusCode="InSeries">
		<awsse:SessionId>00KIDMXCYI</awsse:SessionId>
		<awsse:SequenceNumber>1</awsse:SequenceNumber>
		<awsse:SecurityToken>AV2406LTKKOX3FD7FC9MSFJHT</awsse:SecurityToken>
	</awsse:Session>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
	<PNR_Reply xmlns="http://xml.amadeus.com/PNRACC_16_1_1A">
	<pnrHeader>
		<reservationInfo>
			<reservation>
				<companyId>1A</companyId>
				<controlNumber>MKR8BR</controlNumber>
				<date>261018</date>
				<time>0256</time>
			</reservation>
		</reservationInfo>
	</pnrHeader>
	<securityInformation>
		<responsibilityInformation>
			<typeOfPnrElement>RP</typeOfPnrElement>
			<agentId>WSSU</agentId>
			<officeId>CGYPH2116</officeId>
			<iataCode>28000335</iataCode>
		</responsibilityInformation>
		<queueingInformation>
			<queueingOfficeId>CGYPH2116</queueingOfficeId>
		</queueingInformation>
		<cityCode>CGY</cityCode>
		<secondRpInformation>
			<creationOfficeId>CGYPH2116</creationOfficeId>
			<agentSignature>9998WS</agentSignature>
			<creationDate>261018</creationDate>
			<creatorIataCode>28000335</creatorIataCode>
			<creationTime>0256</creationTime></secondRpInformation>
		</securityInformation>
		<freetextData>
			<freetextDetail>
				<subjectQualifier>3</subjectQualifier>
				<type>P12</type>
			</freetextDetail>
			<longFreetext>--- RLR ---</longFreetext>
		</freetextData>
		<pnrHeaderTag>
			<statusInformation>
				<indicator>RLR</indicator>
			</statusInformation>
		</pnrHeaderTag>
		<sbrPOSDetails>
			<sbrUserIdentificationOwn>
				<originIdentification>
					<originatorId>28000335</originatorId>
					<inHouseIdentification1>CGYPH2116</inHouseIdentification1>
				</originIdentification>
				<originatorTypeCode>N</originatorTypeCode>
			</sbrUserIdentificationOwn>
			<sbrSystemDetails>
				<deliveringSystem>
					<companyId>1A</companyId>
					<locationId>CGY</locationId>
				</deliveringSystem>
			</sbrSystemDetails>
			<sbrPreferences>
				<userPreferences>
					<codedCountry>PH</codedCountry>
				</userPreferences>
			</sbrPreferences>
		</sbrPOSDetails>
		<sbrCreationPosDetails>
			<sbrUserIdentificationOwn>
				<originIdentification>
					<originatorId>28000335</originatorId>
					<inHouseIdentification1>CGYPH2116</inHouseIdentification1>
				</originIdentification>
				<originatorTypeCode>N</originatorTypeCode>
			</sbrUserIdentificationOwn>
			<sbrSystemDetails>
				<deliveringSystem>
					<companyId>1A</companyId>
					<locationId>CGY</locationId>
				</deliveringSystem>
			</sbrSystemDetails>
			<sbrPreferences>
				<userPreferences>
					<codedCountry>PH</codedCountry>
				</userPreferences></sbrPreferences>
			</sbrCreationPosDetails>
			<sbrUpdatorPosDetails>
				<sbrUserIdentificationOwn>
					<originIdentification>
						<originatorId>28000335</originatorId>
						<inHouseIdentification1>CGYPH2116</inHouseIdentification1>
					</originIdentification>
					<originatorTypeCode>N</originatorTypeCode>
				</sbrUserIdentificationOwn>
				<sbrSystemDetails>
					<deliveringSystem>
						<companyId>1A</companyId>
						<locationId>CGY</locationId>
					</deliveringSystem>
				</sbrSystemDetails>
				<sbrPreferences>
					<userPreferences>
						<codedCountry>PH</codedCountry>
					</userPreferences>
				</sbrPreferences>
			</sbrUpdatorPosDetails>
			<technicalData>
				<enveloppeNumberData>
					<sequenceDetails>
						<number>1</number>
					</sequenceDetails>
				</enveloppeNumberData>
				<lastTransmittedEnvelopeNumber>
					<currentRecord>0</currentRecord>
				</lastTransmittedEnvelopeNumber>
				<purgeDateData>
					<dateTime>
						<year>2018</year>
						<month>10</month>
						<day>31</day>
					</dateTime>
				</purgeDateData>
			</technicalData>
			<travellerInfo>
				<elementManagementPassenger>
					<reference>
						<qualifier>PT</qualifier>
						<number>2</number>
					</reference>
					<segmentName>NM</segmentName>
					<lineNumber>1</lineNumber>
				</elementManagementPassenger>
				<passengerData>
					<travellerInformation>
						<traveller>
							<surname>SORIANO</surname>
							<quantity>1</quantity>
						</traveller>
						<passenger>
							<firstName>LOU ARD MR</firstName>
							<type>ADT</type>
						</passenger>
					</travellerInformation>
				</passengerData>
				<enhancedPassengerData>
					<enhancedTravellerInformation>
						<travellerNameInfo>
							<quantity>1</quantity>
							<type>ADT</type>
						</travellerNameInfo>
						<otherPaxNamesDetails>
							<nameType>UN</nameType>
							<referenceName>Y</referenceName>
							<displayedName>Y</displayedName>
							<surname>SORIANO</surname>
							<givenName>LOU ARD MR</givenName>
						</otherPaxNamesDetails>
					</enhancedTravellerInformation>
				</enhancedPassengerData>
			</travellerInfo>
			<originDestinationDetails>
				<originDestination></originDestination>
				<itineraryInfo>
					<elementManagementItinerary>
						<reference>
							<qualifier>ST</qualifier>
							<number>1</number>
						</reference>
						<segmentName>AIR</segmentName>
						<lineNumber>2</lineNumber>
					</elementManagementItinerary>
					<travelProduct>
						<product>
							<depDate>271018</depDate>
							<depTime>0805</depTime>
							<arrDate>271018</arrDate>
							<arrTime>1010</arrTime>
						</product>
						<boardpointDetail>
							<cityCode>HKG</cityCode>
						</boardpointDetail>
						<offpointDetail>
							<cityCode>MNL</cityCode>
						</offpointDetail>
						<companyDetail>
							<identification>PR</identification>
						</companyDetail>
						<productDetails>
							<identification>313</identification>
							<classOfService>M</classOfService>
						</productDetails>
						<typeDetail>
							<detail>ET</detail>
						</typeDetail>
					</travelProduct>
					<itineraryMessageAction>
						<business>
							<function>1</function>
						</business>
					</itineraryMessageAction>
					<itineraryReservationInfo>
						<reservation>
							<companyId>PR</companyId>
							<controlNumber>MKR8BR</controlNumber>
						</reservation>
					</itineraryReservationInfo>
					<relatedProduct>
						<quantity>1</quantity>
						<status>HK</status>
					</relatedProduct>
					<flightDetail>
						<productDetails>
							<equipment>321</equipment>
							<numOfStops>0</numOfStops>
							<weekDay>6</weekDay>
						</productDetails>
						<departureInformation>
							<departTerminal>1</departTerminal>
						</departureInformation>
						<arrivalStationInfo>
							<terminal>2</terminal>
						</arrivalStationInfo>
						<facilities>
							<entertainement>M</entertainement>
							<entertainementDescription>B</entertainementDescription>
						</facilities>
					</flightDetail>
					<selectionDetails>
						<selection>
							<option>P2</option>
						</selection>
					</selectionDetails>
					<carbonDioxydeInfo>
						<carbonDioxydeAmount>
							<quantityDetails>
								<qualifier>COE</qualifier>
								<value>97.684854</value>
								<unit>KPP</unit>
							</quantityDetails>
						</carbonDioxydeAmount>
						<carbonDioxydeInfoSource>
							<freeTextDetails>
								<textSubjectQualifier>3</textSubjectQualifier>
								<source>S</source>
								<encoding>7</encoding>
							</freeTextDetails>
							<freeText>SOURCE:ICAO CARBON EMISSIONS CALCULATOR</freeText>
						</carbonDioxydeInfoSource>
					</carbonDioxydeInfo>
					<markerRailTour></markerRailTour>
				</itineraryInfo>
			</originDestinationDetails>
			<dataElementsMaster>
				<marker2></marker2>
				<dataElementsIndiv>
					<elementManagementData>
						<reference>
							<qualifier>OT</qualifier>
							<number>2</number>
						</reference>
						<segmentName>AP</segmentName>
						<lineNumber>3</lineNumber>
					</elementManagementData>
					<otherDataFreetext>
						<freetextDetail>
							<subjectQualifier>3</subjectQualifier>
							<type>5</type>
						</freetextDetail>
						<longFreetext>CGY 888575704 - LIMCON TRAVEL - A</longFreetext>
					</otherDataFreetext>
				</dataElementsIndiv>
				<dataElementsIndiv>
					<elementManagementData>
						<reference>
							<qualifier>OT</qualifier>
							<number>3</number>
						</reference>
						<segmentName>AP</segmentName>
						<lineNumber>4</lineNumber>
					</elementManagementData>
					<otherDataFreetext>
						<freetextDetail>
							<subjectQualifier>3</subjectQualifier>
							<type>7</type>
						</freetextDetail>
						<longFreetext>09123213213</longFreetext>
					</otherDataFreetext>
					<referenceForDataElement>
						<reference>
							<qualifier>PT</qualifier>
							<number>2</number>
						</reference>
					</referenceForDataElement>
				</dataElementsIndiv>
				<dataElementsIndiv>
					<elementManagementData>
						<reference>
							<qualifier>OT</qualifier>
							<number>4</number>
						</reference>
						<segmentName>TK</segmentName>
						<lineNumber>5</lineNumber>
					</elementManagementData>
					<ticketElement>
						<passengerType>PAX</passengerType>
						<ticket>
							<indicator>OK</indicator>
							<date>261018</date>
							<officeId>CGYPH2116</officeId>
						</ticket>
					</ticketElement>
				</dataElementsIndiv>
			</dataElementsMaster>
		</PNR_Reply>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>```