Implement an Air API by sending a SOAP request

后端 未结 2 1695
难免孤独
难免孤独 2021-01-14 11:47

I have a php web site. Here I need to implement air ticket searching and booking functionality. In order to do this, I have used a paid API from ARZOO web site... I got all

相关标签:
2条回答
  • 2021-01-14 12:39

    i also getting error while using SOAP CLIENT but when i use nusoap then they give me result..using this code if u get error like ip/password mismatch then You will call arzoo to verify your clientid and clientpassword

        <?php
      ini_set('max_execution_time','180');
        include 'lib/nusoap.php';
       $location_URL ='http://avail.flight.arzoo.com';
       $action_URL ='http://demo.arzoo.com/ArzooWS/services/DOMFlightAvailability?wsdl';
    $Request = '<Request>
    <Origin>BOM</Origin>
    <Destination>DEL</Destination>
    <DepartDate>2017-02-02</DepartDate>
    <ReturnDate>2017-02-02</ReturnDate>
    <AdultPax>1</AdultPax>
    <ChildPax>0</ChildPax>
    <InfantPax>0</InfantPax>
    <Currency>INR</Currency>
    <Clientid>Given by Arzoo.com</Clientid>
    <Clientpassword>Given by Arzoo.com</Clientpassword>
    <Clienttype>ArzooFWS1.1</Clienttype>
    <Preferredclass>E</Preferredclass>
    <mode>ONE</mode>
    <PreferredAirline>AI</PreferredAirline>
    </Request>';
    
    $clientinfo = array('soap_version'=>SOAP_1_1,
    'location' =>$location_URL,
    'uri' =>$action_URL,
     'style' => SOAP_RPC,
     'use' => SOAP_ENCODED,
     'trace' => 1,
     );
    
     $client = new nusoap_client('http://demo.arzoo.com/ArzooWS/services/DOMFlightAvailability?wsdl', $clientinfo);
    //print_r($client);
    $result = $client->call('getAvailability', array($Request));
    echo"<pre>";
    print_r($result);
    $clientInfo =simplexml_load_string(utf8_encode($result));
    $flight = $clientInfo->Response__Depart->OriginDestinationOptions->OriginDestinationOption;
    $error =$clientInfo->error__tag;
    //echo $error;
    var_dump($flight);
    //exit;
    //echo"<pre>";
    //print_r($result);
    //ECHO $error;
    ?>
    
    0 讨论(0)
  • 2021-01-14 12:39

    Since they are mentioned standard SOAP client and you are sending the cURL request to the Server that will never give any response.

    $location_URL = "http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability";
    $action_URL ="http://com.arzoo.flight.avail";
    
    $client = new SoapClient('http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl', array(
    'soap_version' => SOAP_1_1,
    'location' => $location_URL,
    'uri'      => $action_URL,
    'style'    => SOAP_RPC,
    'use'      => SOAP_ENCODED,
    'trace'    => 1,
    ));
    
    try
    {
        $result = $client->__call('getAvailability',array($req_int));
        $response= htmlentities($result);
    }
    

    You can use SOAP1.1 Request.

    0 讨论(0)
提交回复
热议问题