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

Soap Client usage #59

Open SergioReis97 opened 7 years ago

SergioReis97 commented 7 years ago

I've been trying to implement some parts of the travelport uapi to a client and having a problem trying to use php SoapClient. So far, i've tried to change some of the downloadable .wsdl, changing the URL from localhost to the prefferable Endpoint ( https://support.travelport.com/webhelp/uapi/Content/Getting_Started/Endpoints_Services.htm ) and using SoapClient as i've done in the past, For example :

<?php

try {

  $chave ="{TOKEN IN https://www.travelportroomsandmore.com/account/edit }";
  $parametros = array(
    "TokenId" => $chave
  );

    /*
    $cliente = new SoapClient('./modelos/hotel_v39_0/Hotel.wsdl', array('trace' => 1));
    foreach ($cliente->__getFunctions() as $tempFunc) {
      if (strpos($tempFunc, 'Search') !== false) {
          var_dump($tempFunc);
          echo "<br>";
      }
    }
    echo "<br><br><br><br>__<br><br><br><br>";
    #$resultado = $cliente->BaseHotelSearchRsp($parametros);
    $resultado = $cliente->__soapCall("service",$parametros);
    var_dump($resultado);
    */
    $cliente = new SoapClient('./modelos/system_v32_0/System.wsdl', array('trace' => 1));
    foreach ($cliente->__getFunctions() as $tempFunc) {
      var_dump($tempFunc);
      echo "<br>";
    }
    #$resultado = $cliente->__soapCall("BaseHotelSearchRsp",$parametros);
    $resultado = $cliente->__soapCall("service",$parametros);

  } catch ( SoapFault $fault ) {
    trigger_error ( "SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR );
  }

  ?>

I can only get to list some of the methods on the SoapClient object but i can't actually invoke them. Also, whenever i try to specify and doing $resultado = $cliente->BaseHotelSearchRsp($parametros); or $resultado = $cliente->__soapCall("BaseHotelSearchRsp",$parametros); I get : "Fatal error: SOAP Fault: (faultcode: Client, faultstring: Function ("BaseHotelSearchRsp") is not a valid method for this service) in ..."

I'm also quite new to this webservice things and so, and only have used a couple of some basics one so I might just be doing alot of basic things bad... Sorry for bad english and thank you in advance

vivekjyotipramanik commented 7 years ago

Hi HipeL,

Thank you for your interest in Travelport Universal API. We don't have any samples with soapClient with PHP. The samples we have are using CURL. We will check the issue your are facing and will provide an update soon. Thanks.

Thanks & Regards Vivekjyoti Pramanik

MRZMUH001 commented 7 years ago

@vivekjyotipramanik - any updates on this issue?

vivekjyotipramanik commented 7 years ago

Hi MRZMUH001,

UAPI soapClient has some issues and works perfectly with CURL as of now. Thanks.