Travelport / travelport-uapi-tutorial

The travelport-uapi-tutorial is a Java project for Universal API that will help you connect and code a standard workflow including Air and Hotel.
45 stars 34 forks source link

Demo site response does not give same results when ran locally #239

Open IdrisHanafi opened 7 years ago

IdrisHanafi commented 7 years ago

I am currently trying to run this query:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                <soapenv:Header/>
                    <soapenv:Body>
                        <air:LowFareSearchReq xmlns:air="http://www.travelport.com/schema/air_v34_0" xmlns:com="http://www.travelport.com/schema/common_v34_0" AuthorizedBy="user" SolutionResult="true" TargetBranch="P7015242" TraceId="trace">
                            <com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
                            <air:SearchAirLeg>
                                <air:SearchOrigin>
                                    <com:Airport Code="DTW"/>
                                </air:SearchOrigin>
                                <air:SearchDestination>
                                    <com:Airport Code="JRB"/>
                                </air:SearchDestination>
                                <air:SearchDepTime PreferredTime="2016-12-20"/>
                            </air:SearchAirLeg>
                            <air:SearchAirLeg>
                                <air:SearchOrigin>
                                    <com:Airport Code="JRB"/>
                                </air:SearchOrigin>
                                <air:SearchDestination>
                                    <com:Airport Code="DTW"/>
                                </air:SearchDestination>
                                <air:SearchDepTime PreferredTime="2016-12-23"/>
                            </air:SearchAirLeg>
                            <air:AirSearchModifiers>
                                <air:PreferredProviders>
                                    <com:Provider Code="1G"/>
                                </air:PreferredProviders>
                            </air:AirSearchModifiers>
                            <com:SearchPassenger BookingTravelerRef="gr8AVWGCR064r57Jt0+8bA==" Code="ADT"/>
                        </air:LowFareSearchReq>
                    </soapenv:Body>
</soapenv:Envelope>

But I get this error:

<?xml version="1.0" ?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP:Body>
                <SOAP:Fault>
                        <faultcode>Server.Business</faultcode>
                        <faultstring>NO AVAILABILITY FOR THIS REQUEST</faultstring>
                        <detail>
                                <common_v34_0:ErrorInfo xmlns:common_v34_0="http://www.travelport.com/schema/common_v34_0">
                                        <common_v34_0:Code>3037</common_v34_0:Code>
                                        <common_v34_0:Service>AIRSVC</common_v34_0:Service>
                                        <common_v34_0:Type>Business</common_v34_0:Type>
                                        <common_v34_0:Description>No availability on chosen flights.</common_v34_0:Description>
                                        <common_v34_0:TransactionId>00AF59CA0A076477F18E6EB812BE4A55</common_v34_0:TransactionId>
                                        <common_v34_0:TraceId>trace</common_v34_0:TraceId>
                                </common_v34_0:ErrorInfo>
                        </detail>
                </SOAP:Fault>
        </SOAP:Body>
</SOAP:Envelope>

However when I run this exact query in your demo site it returns flights. So then I copied the exact same XML request and ran it locally, I get this error:

<?xml version="1.0" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SOAP-ENV:Body>
                <SOAP-ENV:Fault>
                        <SOAP-ENV:faultcode>400</SOAP-ENV:faultcode>
                        <SOAP-ENV:faultstring>TPGateway - Request data not found - Request ignored -  service name = AirService username = Universal API/uAPI5446387789-46f8ce07</SOAP-ENV:faultstring>
                        <SOAP-ENV:faultactor>            </SOAP-ENV:faultactor>
                        <SOAP-ENV:detail>TPGateway - Request data not found - Request ignored -  service name = AirService username = Universal API/uAPI5446387789-46f8ce07</SOAP-ENV:detail>
                </SOAP-ENV:Fault>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Please let me know where I went wrong and thanks in advance.

Also, the URL I am sending my request to is https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService and my user/pass are Universal API/uAPI5446387789-46f8ce07 and YdsN3hXxt4neNr2gCJRPjRs6f, respectively. If needed, my branch code is P7015242. Lastly, I am still using the demo version so the branch, user, and pass are temporary.

NirandaG commented 7 years ago

Hi IdrisHanafi,

The reason the results are not returning is, there are no fares for the city pair you are requesting. Please find the below request with successful response.

``xml

``xml Thank you, B.Rgds, Niranda
IdrisHanafi commented 7 years ago

Hi @NirandaG

I have tested the exact city pairs on your demo site which gave results. The XML request your site has requested is:

<LowFareSearchReq xmlns="http://www.travelport.com/schema/air_v36_0" TraceId="deaacd5a-9c80-40be-a2b8-33254f02ec00" TargetBranch="P1875761" ReturnUpsellFare="true">
  <BillingPointOfSaleInfo xmlns="http://www.travelport.com/schema/common_v36_0" OriginApplication="uAPI" />
  <SearchAirLeg>
    <SearchOrigin>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="DTW" PreferCity="true" />
    </SearchOrigin>
    <SearchDestination>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="JRB" PreferCity="true" />
    </SearchDestination>
    <SearchDepTime PreferredTime="2016-12-20" />
  </SearchAirLeg>
  <SearchAirLeg>
    <SearchOrigin>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="JRB" PreferCity="true" />
    </SearchOrigin>
    <SearchDestination>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="DTW" PreferCity="true" />
    </SearchDestination>
    <SearchDepTime PreferredTime="2016-12-23" />
  </SearchAirLeg>
  <AirSearchModifiers>
    <PreferredProviders>
      <Provider xmlns="http://www.travelport.com/schema/common_v36_0" Code="1G" />
    </PreferredProviders>
  </AirSearchModifiers>
  <SearchPassenger xmlns="http://www.travelport.com/schema/common_v36_0" Code="ADT" Age="40" DOB="1976-12-15" />
  <AirPricingModifiers FaresIndicator="PublicFaresOnly">
    <AccountCodes>
      <AccountCode xmlns="http://www.travelport.com/schema/common_v36_0" Code="-" />
    </AccountCodes>
  </AirPricingModifiers>
</LowFareSearchReq>

Which I then tested locally and it gave me the following error:

<?xml version="1.0" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SOAP-ENV:Body>
                <SOAP-ENV:Fault>
                        <SOAP-ENV:faultcode>400</SOAP-ENV:faultcode>
                        <SOAP-ENV:faultstring>TPGateway - Request data not found - Request ignored -  service name = AirService username = Universal API/uAPI5446387789-46f8ce07</SOAP-ENV:faultstring>
                        <SOAP-ENV:faultactor>            </SOAP-ENV:faultactor>
                        <SOAP-ENV:detail>TPGateway - Request data not found - Request ignored -  service name = AirService username = Universal API/uAPI5446387789-46f8ce07</SOAP-ENV:detail>
                </SOAP-ENV:Fault>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Are there any reasons for this? Are the requests your site uses not exactly the ones it display?

vivekjyotipramanik commented 7 years ago

Hi IdrisHanafi,

Could you please add the Soap envelope and body before and after the request. Please let me know how it goes. Thanks.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>

   </soapenv:Body>
</soapenv:Envelope>

Thanks & Regards Vivekjyoti Pramanik

IdrisHanafi commented 7 years ago

Hi @vivekjyotipramanik

That is what I initially ran it with and it still gave me the error:

<?xml version="1.0" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SOAP-ENV:Body>
                <SOAP-ENV:Fault>
                        <SOAP-ENV:faultcode>400</SOAP-ENV:faultcode>
                        <SOAP-ENV:faultstring>TPGateway - Request data not found - Request ignored -  service name = AirService username = Universal API/uAPI5446387789-46f8ce07</SOAP-ENV:faultstring>
                        <SOAP-ENV:faultactor>            </SOAP-ENV:faultactor>
                        <SOAP-ENV:detail>TPGateway - Request data not found - Request ignored -  service name = AirService username = Universal API/uAPI5446387789-46f8ce07</SOAP-ENV:detail>
                </SOAP-ENV:Fault>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I also sent this request to the URL: https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService Are there any possible reasons why the demo site returns flight while ran locally it doesn't?

NirandaG commented 7 years ago

Hi IdrisHanafi,

This is something unusual. The same request working well locally in my end not. I am not checking on the Demo site. Could you please send me the full request you are passing on?

Thank you, B.Rgds, Niranda

IdrisHanafi commented 7 years ago

Hi @NirandaG

I am trying to run:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                <soapenv:Header/>
                    <soapenv:Body>
<LowFareSearchReq xmlns="http://www.travelport.com/schema/air_v36_0" TraceId="801b5521-ac8a-4ce9-81a0-917ca4d7dceb" TargetBranch="P7015242" ReturnUpsellFare="true">
  <BillingPointOfSaleInfo xmlns="http://www.travelport.com/schema/common_v36_0" OriginApplication="uAPI" />
  <SearchAirLeg>
    <SearchOrigin>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="DTW" PreferCity="true" />
    </SearchOrigin>
    <SearchDestination>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="JRB" PreferCity="true" />
    </SearchDestination>
    <SearchDepTime PreferredTime="2016-12-20" />
  </SearchAirLeg>
  <SearchAirLeg>
    <SearchOrigin>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="JRB" PreferCity="true" />
    </SearchOrigin>
    <SearchDestination>
      <CityOrAirport xmlns="http://www.travelport.com/schema/common_v36_0" Code="DTW" PreferCity="true" />
    </SearchDestination>
    <SearchDepTime PreferredTime="2016-12-23" />
  </SearchAirLeg>
  <AirSearchModifiers>
    <PreferredProviders>
      <Provider xmlns="http://www.travelport.com/schema/common_v36_0" Code="1G" />
    </PreferredProviders>
  </AirSearchModifiers>
  <SearchPassenger xmlns="http://www.travelport.com/schema/common_v36_0" Code="ADT" Age="40" DOB="1976-12-15" />
  <AirPricingModifiers FaresIndicator="PublicFaresOnly">
    <AccountCodes>
      <AccountCode xmlns="http://www.travelport.com/schema/common_v36_0" Code="-" />
    </AccountCodes>
  </AirPricingModifiers>
</LowFareSearchReq>
</air:LowFareSearchReq>
                    </soapenv:Body>
                </soapenv:Envelope>

The URL i am sending this request to is: https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/AirService.

Also my account is still under the trial version. Could this be the reason? If you want to test it out, my user name and password is Universal API/uAPI5446387789-46f8ce07 and YdsN3hXxt4neNr2gCJRPjRs6f, respectively.

vivekjyotipramanik commented 7 years ago

Hi IdrisHanafi,

The request being sent had an extra tag which was causing the issue. Please find below the corrected request. Please let me know how it goes. Thanks.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <LowFareSearchReq TraceId="801b5521-ac8a-4ce9-81a0-917ca4d7dceb" TargetBranch="P7015242" ReturnUpsellFare="true" xmlns="http://www.travelport.com/schema/air_v36_0">
         <BillingPointOfSaleInfo OriginApplication="uAPI" xmlns="http://www.travelport.com/schema/common_v36_0"/>
         <SearchAirLeg>
            <SearchOrigin>
               <CityOrAirport Code="DTW" PreferCity="true" xmlns="http://www.travelport.com/schema/common_v36_0"/>
            </SearchOrigin>
            <SearchDestination>
               <CityOrAirport Code="JRB" PreferCity="true" xmlns="http://www.travelport.com/schema/common_v36_0"/>
            </SearchDestination>
            <SearchDepTime PreferredTime="2016-12-20"/>
         </SearchAirLeg>
         <SearchAirLeg>
            <SearchOrigin>
               <CityOrAirport Code="JRB" PreferCity="true" xmlns="http://www.travelport.com/schema/common_v36_0"/>
            </SearchOrigin>
            <SearchDestination>
               <CityOrAirport Code="DTW" PreferCity="true" xmlns="http://www.travelport.com/schema/common_v36_0"/>
            </SearchDestination>
            <SearchDepTime PreferredTime="2016-12-23"/>
         </SearchAirLeg>
         <AirSearchModifiers>
            <PreferredProviders>
               <Provider Code="1G" xmlns="http://www.travelport.com/schema/common_v36_0"/>
            </PreferredProviders>
         </AirSearchModifiers>
         <SearchPassenger Code="ADT" Age="40" DOB="1976-12-15" xmlns="http://www.travelport.com/schema/common_v36_0"/>
         <AirPricingModifiers FaresIndicator="PublicFaresOnly">
            <AccountCodes>
               <AccountCode Code="-" xmlns="http://www.travelport.com/schema/common_v36_0"/>
            </AccountCodes>
         </AirPricingModifiers>
      </LowFareSearchReq>
   </soapenv:Body>
</soapenv:Envelope>

Thanks & Regards Vivekjyoti Pramanik