Sabre PassengerDetailsRQ not return the ID attribute in ItineraryRef - sabre

I am trying to book an air segment using EnhancedAirBookRQ and PassengerDetailsRQ using development endpoint.
But in the response I did not get the ID it just sending the information like
<ItineraryRef AirExtras="false" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
but i should return like <ItineraryRef AirExtras="false" ID="DJEJWQ" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
Is there any reason for this? bellow is my request XML code.
<PassengerDetailsRQ xmlns="http://services.sabre.com/sp/pd/v3_4" version="3.4.0">
<PostProcessing >
<RedisplayReservation waitInterval="1000"/>
</PostProcessing>
<PreProcessing />
<SpecialReqDetails>
<SpecialServiceRQ>
<SpecialServiceInfo>
<AdvancePassenger SegmentNumber="A">
<Document ExpirationDate="2018-05-26" Number="1234567890" Type="P">
<IssueCountry>FR</IssueCountry>
<NationalityCountry>FR</NationalityCountry>
</Document>
<PersonName DateOfBirth="1980-12-02" Gender="M" NameNumber="1.1">
<GivenName>JAMES</GivenName>
<MiddleName>MALCOLM</MiddleName>
<Surname>GREEN</Surname>
</PersonName>
</AdvancePassenger>
</SpecialServiceInfo>
</SpecialServiceRQ>
</SpecialReqDetails>
<TravelItineraryAddInfoRQ>
<AgencyInfo>
<Address>
<AddressLine>SABRE TRAVEL</AddressLine>
<CityName>SOUTHLAKE</CityName>
<CountryCode>US</CountryCode>
<PostalCode>76092</PostalCode>
<StateCountyProv StateCode="TX"/>
<StreetNmbr>3150 SABRE DRIVE</StreetNmbr>
<VendorPrefs>
<Airline Hosted="true"/>
</VendorPrefs>
</Address>
</AgencyInfo>
<CustomerInfo>
<ContactNumbers>
<ContactNumber NameNumber="1.1" Phone="817-555-1212" PhoneUseType="H"/>
</ContactNumbers>
<PersonName NameNumber="1.1" NameReference="ABC123" PassengerType="ADT">
<GivenName>MALCOLM</GivenName>
<Surname>GREEN</Surname>
</PersonName>
</CustomerInfo>
</TravelItineraryAddInfoRQ>
</PassengerDetailsRQ>
Thanks

Related

WSO2 : Transforming response xml

I would like to turn this xml response into something more easily readable.
<?xml version="1.0" encoding="ISO-8859-1"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
<soap:Body>
<executeResponse xmlns="urn:GCE">
<BusinessViewServiceexecuteOut xmlns="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" xmlns:ns2="http://www.generixgroup.com/processus/configuration/scheduler" xmlns:ns3="http://www.generix.fr/technicalframework/business/service/common">
<xmlpres><?xml version = '1.0' encoding = 'UTF-8'?> <VueTable type="View" name="Table" habctr="true" total_business_row="2" nbline="400" confNbline="400" numpage="1" nbpage="1">
<JTblView name="JTblView" type="ViewObject" maxfetchsize="999" maxfetchsizeexceeded="false">
<JTblViewRow current="true" type="ViewRow" index="1" business_row_index="1">
<Cletbl precision="6" type="VARCHAR" pk="true">
<business_data>N</business_data>
</Cletbl>
<Codtbl precision="6" type="VARCHAR" pk="true">
<business_data>001</business_data>
</Codtbl>
<Lib1 precision="30" type="VARCHAR">
<business_data>Non</business_data>
</Lib1>
<Lib2 precision="30" type="VARCHAR">
<business_data/>
</Lib2>
<Lir precision="10" type="VARCHAR">
<business_data>Non</business_data>
</Lir>
</JTblViewRow>
<JTblViewRow type="ViewRow" index="2" business_row_index="2">
<Cletbl precision="6" type="VARCHAR" pk="true">
<business_data>O</business_data>
</Cletbl>
<Codtbl precision="6" type="VARCHAR" pk="true">
<business_data>001</business_data>
</Codtbl>
<Lib1 precision="30" type="VARCHAR">
<business_data>Oui</business_data>
</Lib1>
<Lib2 precision="30" type="VARCHAR">
<business_data/>
</Lib2>
<Lir precision="10" type="VARCHAR">
<business_data>Oui</business_data>
</Lir>
</JTblViewRow>
</JTblView>
</VueTable></xmlpres>
</BusinessViewServiceexecuteOut>
</executeResponse>
</soap:Body></soap:Envelope>
At least if I could extract what's in the value of "xmlpres", the better I could do:
<table><row><code></code><libelle></libelle/></row></table>
To then turn it into a json response but I can't see ... I just get all the output or in json stream but with everything , which is not usable.
Create an out-mediation sequence with the following content and attach it to the respective API and try out the scenario. This is to extract the xmlpres content and send that as the response to the client
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="out-sequence">
<!-- extract the xmlpres content and store as OM element -->
<property name="XMLBody"
expression="$body//soap:Body//generic:xmlpres"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:gce="urn:GCE"
xmlns:generic="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" type="OM" />
<!-- pass the extracted property as response body -->
<enrich>
<source type="property" property="XMLBody" />
<target type="body" />
</enrich>
</sequence>
Hope this helps you to extract and send the response accordingly.

How to access attributes including headers, queryparams in Munit set Event processor. I am using Anypoint Studio 7.5

How to access attributes including headers, queryparams in Munit set Event processor. I am using Anypoint Studio 7.5
I have tried with <munit:attributes value="#[{headers : {'token' :'value1'}}]" encoding="UTF-16" /> but it didn't worked.
<sub-flow name="setUserAndPass">
<choice doc:name="Choice" >
<when expression='attributes."headers"."authorization" != null'>
<ee:transform doc:name="Transform Message" >
<ee:message >
</ee:message>
<ee:variables >
<ee:set-variable variableName="userAndPass" ><![CDATA[%dw 2.0
import * from dw::core::Binaries
output text/json
var auth = attributes."headers"."authorization"
---
(fromBase64((auth splitBy(" "))[1] as Binary)) splitBy(":")]]></ee:set-variable>
</ee:variables>
</ee:transform>
<set-variable value='#[vars.userAndPass[0]]' doc:name="Set lvUSERNAME Variable" variableName="lvUSERNAME"/>
<set-variable value='#[vars.userAndPass[1]]' doc:name="Set lvPASSWORD variable" variableName="lvPASSWORD "/>
</when>
<otherwise >
<set-variable value='#[attributes."headers"."username"]' doc:name="Set lvUSERNAME Variable" variableName="lvUSERNAME" />
<set-variable value='#[attributes."headers"."password"]' doc:name="Set lvPASSWORD Variable" variableName="lvPASSWORD" />
</otherwise>
</choice>
</sub-flow>
Munit Flow:
<munit:test name="appname-test-suite-setUserAndPassTest" description="Test">
<munit:behavior >
<munit:set-event doc:name="Set Event">
<munit:attributes value="#[
{
headers : {'authorization': 'authvalue'}
}]" />
</munit:set-event>
</munit:behavior>
<munit:execution >
<flow-ref doc:name="Flow-ref to setUserAndPass" name="setUserAndPass"/>
</munit:execution>
<munit:validation >
<munit-tools:assert-equals doc:name="Assert equals" actual="#[vars.lvUSERNAME]" expected="usernamevalue"/>
</munit:validation>
</munit:test>
It should like this:
<munit:set-event doc:name="Set Event">
<munit:payload value="#['..']" encoding="UTF-16" />
<munit:attributes value="#[
{
headers : {'token': 'value1'},
queryParams : {'queryParam1': 'value2'}
}]" encoding="UTF-16" />
</munit:set-event>

Need to use yatra.com API in my website

asalamualikum , I need to used yatra.com api on my website which is an asp.net website.I have got a word document from yatra(air integration document). Yatra api is xml based , air integration document shows format of xml requests and responses but I haven't used xml in webservices and have no idea but I have concept of xml but have used xml only to read and write files on local system.Now I have a problem I dont know how to use xml in webservices and how to recieve response from api and display it on my page or sent request to api..If any one can help me I will be very thankful to him......If you could give me ne url or a video where user have used some api(xml based) for integration. Help will be strongly appreciated.If anyone can give me sample code for below request and resonse.
Sample request to yatra api:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<OTA_AirLowFareSearchRQ EchoToken="0" SequenceNmbr="0" TransactionIdentifier="0" AvailableFlightsOnly="" DirectFlightsOnly="" xmlns="http://www.opentravel.org/OTA/2003/05">
<POS xmlns="http://www.opentravel.org/OTA/2003/05">
<Source AgentSine="" PseudoCityCode="NPCK" TerminalID="1">
<RequestorID ID="AFFILIATE"/>
</Source>
<YatraRequests>
<YatraRequest AffiliateID="EASTBOUND"/>
</YatraRequests>
</POS>
<TravelerInfoSummary>
<AirTravelerAvail>
<PassengerTypeQuantity Code="ADT" Quantity="1"/>
<PassengerTypeQuantity Code="CHD" Quantity="1"/>
<PassengerTypeQuantity Code="INF" Quantity="1"/>
</AirTravelerAvail>
</TravelerInfoSummary>
<SpecificFlightInfo>
<Airline Code=""/>
</SpecificFlightInfo>
<OriginDestinationInformation>
<DepartureDateTime>2011-09-11T00:00:00</DepartureDateTime>
<OriginLocation CodeContext="IATA" LocationCode="DEL">DEL</OriginLocation>
<DestinationLocation CodeContext="IATA" LocationCode="BOM">BOM</DestinationLocation>
</OriginDestinationInformation>
<TravelPreferences>
<VendorPref Code="SG"/>
<VendorPref Code="DN"/>
<CabinPref Cabin=""/>
</TravelPreferences>
</OTA_AirLowFareSearchRQ>
</soapenv:Body>
</soapenv:Envelope>
Sample Response from yatra api
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<OTA_AirLowFareSearchRS Version="2.001" xmlns="http://www.opentravel.org/OTA/2003/05">
<PricedItineraries>
<PricedItinerary CompositeFlightNumber="S2101" CountCompositeFlightNumber="1" OriginDestinationRPH="0" SequenceNumber="1" SupplierSystem="Amadeus">
<AirItinerary SupplierSystem="Amadeus">
<OriginDestinationOptions>
<OriginDestinationOption Duration="01:55:00" FromCache="true" SupplierSystem="Amadeus">
<FlightSegment ArrivalDateTime="2007-11-11T08:55:00" DepartureDateTime="2007-11-11T07:00:00" E_TicketEligibility="Eligible" FlightNumber="101" RPH="1" ResBookDesigCode="O">
<BookingClassAvail RPH="1" ResBookDesigCode="O" ResBookDesigQuantity="4"/>
<DepartureAirport LocationCode="DEL"/>
<ArrivalAirport LocationCode="BOM"/>
<Equipment AirEquipType="737"/>
<MarketingAirline Code="S2"/>
</FlightSegment>
<FormData>
<FareInformationIDs>
<FareInformationID BaseFare="1825" Code="" FareCode="UGOSAVE" FareID="0" PTCID="1" Quantity="">0</FareInformationID>
</FareInformationIDs>
</FormData>
</OriginDestinationOption>
</OriginDestinationOptions>
</AirItinerary>
<AirItineraryPricingInfo>
<ItinTotalFare>
<BaseFare Amount="1875" CurrencyCode="INR"/>
<Taxes>
<Tax Amount="1575" CurrencyCode="INR" TaxCode="TTL"/>
</Taxes>
<TotalFare Amount="3461.63" CurrencyCode="INR"/>
<ServiceTax Amount="11.63" Currency="INR" Description="Service Tax" ServiceTaxCode="ST" ServiceTaxRate="0.0062"/>
</ItinTotalFare>
<PTC_FareBreakdowns>
<PTC_FareBreakdown>
<PassengerTypeQuantity Code="ADT" Quantity="1"/>
<FareBasisCodes>
<FareBasisCode>OSASAS</FareBasisCode>
</FareBasisCodes>
<PassengerFare>
<BaseFare Amount="1875" CurrencyCode="INR"/>
<Taxes>
<Tax Amount="1575" CurrencyCode="INR" TaxCode="TTL"/>
</Taxes>
<TotalFare Amount="3450" CurrencyCode="INR"/>
</PassengerFare>
</PTC_FareBreakdown>
</PTC_FareBreakdowns>
<FareInfos>
<FareInfo>
<FareReference>OSASAS</FareReference>
<FilingAirline Code="ZZ"/>
<DepartureAirport LocationCode="DEL"/>
<ArrivalAirport LocationCode="BOM"/>
</FareInfo>
</FareInfos>
</AirItineraryPricingInfo>
<TicketingInfo DeliveryMethod="EMAIL" TicketTimeLimit="" TicketType="eTicket" TicketingStatus="" eTicketNumber="">
<TicketAdvisory Language="English"/>
</TicketingInfo>
</PricedItinerary>
</PricedItineraries>
</OTA_AirLowFareSearchRS>
</soapenv:Body>
</soapenv:Envelope>
You no need to worry about creating the xml or consuming the xml, if you are using C sharp side use WCF or any tool to create client by using Yatra.com wsdl.
Now treat evrthing as object oriented it will be responsibility of your C sharp client stubs to generate XML. you just need to map the values in stubs.

.net to coldfusion web service xml parsing

I'm almost there with this project. Given the xml below:
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<debtor xmlns="http://tempuri.org/Database.xsd">
<Customer diffgr:id="Customer1" msdata:rowOrder="0" diffgr:hasErrors="true">
<SeqNo>-1</SeqNo>
<AccGroup>1</AccGroup>
<AccountTypeID>1</AccountTypeID>
<CompaniesOfficeID>-4</CompaniesOfficeID>
<DOB />
<SignupDate>18/04/2007</SignupDate>
<DeferredDate />
<TeleSalesNo>5</TeleSalesNo>
<PIN>4433</PIN>
<Name>MR DAVID GETTI</Name>
<Salutation>MR</Salutation>
<FirstName>DAVID</FirstName>
<LastName>GETTI</LastName>
<Phone>64 7 555 522</Phone>
<Fax />
<CellPhone>64 25 999 999</CellPhone>
<Email>dave.getti#cpass.net.nz</Email>
<AfterHrs_Contact />
<SalesNo>0</SalesNo>
<CreditStatus>1</CreditStatus>
<RefGroupNo>0</RefGroupNo>
<PriceNo>-1</PriceNo>
<SmartLineProvider>-1</SmartLineProvider>
<Contact>DAVID GETTI</Contact>
<CustomerCode>1111111</CustomerCode>
<HasCellPhone>false</HasCellPhone>
<InvoiceOptions>12</InvoiceOptions>
<TradingAs>MR DAVID GETTI</TradingAs>
<FranchiseCode>-1</FranchiseCode>
<Existing>true</Existing>
<Address diffgr:id="Address1" msdata:rowOrder="0">
<SeqNo>-1</SeqNo>
<CustomerSeqNo>-1</CustomerSeqNo>
<Show>30</Show>
<TypeSelected>2</TypeSelected>
<Name>PostalAddress</Name>
<AddressNumber />
<Address1>88 Blue Lane East</Address1>
<Address2>REMA</Address2>
<Address3>AKL</Address3>
<Address4 />
<PostCode>1050</PostCode>
<LocationCode>0</LocationCode>
<AgentID>0</AgentID>
</Address>
<Address diffgr:id="Address2" msdata:rowOrder="1">
<SeqNo>-2</SeqNo>
<CustomerSeqNo>-1</CustomerSeqNo>
<Show>10</Show>
<TypeSelected>2</TypeSelected>
<Name>PhysicalAddress</Name>
<AddressNumber />
<Address1>44 OHINA STREET</Address1>
<Address2>REMA</Address2>
<Address3>AKL</Address3>
<Address4 />
<PostCode>1098</PostCode>
<LocationCode>1</LocationCode>
<AgentID>1</AgentID>
</Address>
I can access all the data, except the address details and populate a query object, using the code below:
<cfset Local.xRows = Local.xData["diffgr:diffgram"]["debtor"] />
<cfloop from="1" to="#arrayLen(Local.xRows.xmlChildren)#" index="Local.i">
<cfset Local.thisRow = Local.xRows.xmlChildren[Local.i] />
<cfset Local.tableName = Local.thisRow.xmlName />
<cfset queryAddRow(Local.result[Local.tableName], 1) />
<cfloop from="1" to="#arrayLen(Local.thisRow.xmlChildren)#" index="Local.j">
<cfif listfindnocase(vCols,Local.thisRow.xmlChildren[Local.j].xmlName)>
<cfset querySetCell(Local.result[Local.tableName], Local.thisRow.xmlChildren[Local.j].xmlName, Local.thisRow.xmlChildren[Local.j].xmlText, Local.result[Local.tableName].recordCount) />
</cfif>
</cfloop>
</cfloop>
However, I am stuck with how to access the individual address detail nodes under the main address node:
<Address diffgr:id="Address1" msdata:rowOrder="0">
Any help would be greatly appreciated.
I think you're trying to reference those individual nodes using an absolute reference instead of the easier local reference you get by using cfloop.
<cfset xmlCustomerInfo = xmlDoc.info[ "Customer" ][ Local.i ] />
<cfset arrAddressList = xmlCustomerInfo[ "Address" ] />
<cfloop
index="Local.j"
from="1"
to="#ArrayLen( arrAddressList )#"
step="1">
<cfset innerAddressNode = arrAddressList[ Local.j ] />
</cfloop>
Here are some great references to parsing XML in Coldfusion.
WARNING: Code is un-tested, just based on what you presented and how coldfusion parses Xml documents.

XML Parsing error in Flex

I am passing a XML document form the Java to Flex using Remote Object.
My XML is as follows
"
<root
<dept ID="1" Name="RND"
<Emp ID="1" Name="Aj"/>
</dept>
<dept ID="2" Name="ENG">
<Emp ID="1" Name="Aj"/>
</dept>
<dept ID="3" Name="MECH">
<Emp ID="1" Name="Aj"/>
</dept>
</root>
"
In Flex i am trying to access using below code
treeData = event.result as XML;
deptTree.dataProvider = treeData;
When i am trying to access the result object and i am getting the below exception
"
[RPC Fault faultString="org.w3c.dom.DOMException : INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. " faultCode="Server.Processing" faultDetail="null"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at NetConnectionMessageResponder/statusHandler()
at mx.messaging::MessageResponder/status()
"
Please help me to resolve this issue.
Thanks in advance.
Aj
<root
<dept ID="1" Name="RND"
Close root tag:
<root>

Resources