Travelport / travelport-uapi-tutorial-php

The travelport-uapi-tutorial-php is a PHP project for Universal API that will help you connect and code a standard workflow including Air, Vehicle, and Hotel.
35 stars 47 forks source link

PHP SoapClient #82

Open nitincdac opened 7 years ago

nitincdac commented 7 years ago

Hello

Currently I am using this with CURL.
Can you please share some example that how can we use this with PHP SoapClient ?

Thanks

vivekjyotipramanik commented 7 years ago

Hi nitincdac,

As of now, we do not have any example on SoapClient with PHP. Also, using SoapClient in PHP does not work well with UAPI and we have seen some issues with it. Thanks.

nitincdac commented 7 years ago

Ok, great... then I will stay with CURL.

So please tell me the best way to add the dynamic options to the CURL message with PHP. e.g

This is my current request message :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <air:LowFareSearchReq TraceId="trace" AuthorizedBy="user" SolutionResult="true" TargetBranch="${Properties Air#EB}" xmlns:air="http://www.travelport.com/schema/air_v42_0" xmlns:com="http://www.travelport.com/schema/common_v42_0">
         <com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
         <air:SearchAirLeg>
            <air:SearchOrigin>
               <com:Airport Code="YUL"/>
            </air:SearchOrigin>
            <air:SearchDestination>
               <com:Airport Code="YYZ"/>
            </air:SearchDestination>
            <air:SearchDepTime PreferredTime="2017-10-07"/>
         </air:SearchAirLeg>
         <air:AirSearchModifiers>
            <air:PreferredProviders>
               <com:Provider Code="1V"/>
            </air:PreferredProviders>
            <air:PermittedCarriers>
               <com:Carrier Code="AC"/>
            </air:PermittedCarriers>
         </air:AirSearchModifiers>
         <com:SearchPassenger BookingTravelerRef="1" Code="ADT"/>
      </air:LowFareSearchReq>
   </soapenv:Body>
</soapenv:Envelope>

I am using the this example : https://github.com/Travelport/travelport-uapi-tutorial-php/blob/master/Air/phpSample_Air_LFS.php

now I want to add two more elements dynamically:

  1. Return Flight tag
  2. CabinClass

how would I do that ?

Thanks

MRZMUH001 commented 7 years ago

Hi vivekjyotipramanik.

Sorry to hijack the thread, but do you know of the issues which came up with using SoapClient with UAPI?

vivekjyotipramanik commented 7 years ago

Hi nitincdac,

We are working on a sample to dynamically create the request xml for LowFareSearch with the version 42 of UAPI and will post it by end of this week or early next week. Thanks.

vivekjyotipramanik commented 7 years ago

Hi nitincdac,

We have added a new sample to create a dynamic LowFareSearchReq using CURL. We have uploaded the code. More similar codes coming in recent days regarding AirPriceReq and AirCreateResrevaionReq with dynamic XML creation. Thanks.

We are conducting a card sort to inform our communications with developers. If you are an API Developer, we would appreciate it if you would take 10-15 minutes to complete this card sort.

Thank you for your help.

http://ows.io/os/rymf2c6k

nitincdac commented 7 years ago

Hi vivekjyotipramanik

I have checked the example. Thanks very much for the quick solution. It lookes good to me & will work on this. If anythig goes wrong, I will let you know.

regards

rajeshtandukar commented 6 years ago

Hi vivekjyotipramanik, Does now PHP SoapClient works well with UAPI ? I am using Curl for now ny UAPI Version is v41_0

Regards, Rajesh

vivekjyotipramanik commented 6 years ago

Hi @rajeshtandukar,

SOAPClient does not work with UAPI properly as proxy generation tools for SOAPClient does not generate the proxy classes correctly for UAPI due to complexity of the schema. Please use CURL for now. Thanks.

waddedMeat commented 4 years ago

@vivekjyotipramanik the issue is not due to the "complexity of the schema" as @vivekjyotipramanik stated. The issue with the PHP SoapClient are due to all of the soap methods/operations having the same name; they are all named "service".

When implementing a previous version of the UAPI, we had to create custom WSDLs. Good luck to anyone who lands on this in search for hope. You are not alone! Keep up the good fight!