web services - Getting response from SOAP in php -


i trying response web service using soap in php.actually paid api fore booking flights.i have 2 cases problem,in both cases didnt response properly.

here code

        try{         $client = new soapclient($url);         print_r($client->__getfunctions());         $values = $client->getavailability($input_xml);         print_r($values);         }catch(exception $e){             echo 'error<br>';             echo $e->getmessage();         } 

case 1

$url=http://59.162.33.102/arzoows/services/domflightavailability

in case exception

soap-error: parsing wsdl: couldn't find in 'http://59.162.33.102/arzoows/services/domflightavailability'

case 2

$url=http://59.162.33.102/arzoows/services/domflightavailability?wsdl

in case no exception output of __getfunctions() response

invalid xml format

i had contacted api service providers , running. here xml

<?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>               <getavailability xmlns="http://avail.flight.arzoo.com">               <in0>                 <request>                    <origin>bom</origin>                 <destination>blr</destination>                 <departdate>2015-05-15</departdate>                 <returndate>2015-05-20</returndate>                 <adultpax>1</adultpax>                 <childpax>1</childpax>                 <infantpax>1</infantpax>                 <currency>inr</currency>                 <preferredclass>b</preferredclass>                  <mode>round</mode>                  <clientid>7xxx</clientid>                 <clientpassword>xx</clientpassword>                 <clienttype>xxx</clienttype>                 <preferredairline>ai,g8,ic,6e</preferredairline>                 </request>          </in0>     </getavailability>     </soapenv:body></soapenv:envelope> 

update here sample response of 1 flight

20875             7303             130             0             0             0               0             0             0                 319             blr             2015-05-15t07:45:00             bom             2015-05-15t06:15:00             603             ai             603              0             air india             3860             http://live.arzoo.com/flightws/image/airindia.gif                 3               z                 13250               z               6625               business               mek+yu2iz7q=               1000               fare non refundable booking class : z|cancellation penalty: bookings done subject cancellation penalty levied airlines.<br>in addition airlines cancellation penalty, charge service fee of rs. 50 per passenger cancellations.|date change penalty: in addition airlines date change penalty, charge service fee of rs. 50 per passenger.|               0               0               0              0             3369             74             2150,147,1563             2150,147,1072             0,0,74             0           arzoo11         h/jf17qhsjphwfsotfwg8tk50vhvm+kkk3mjj4nqtdo3mxltqg2qnsctjzh+twn+pnuriytjykow o8yh8+0tznjzpdcapjt4kqtfirjrrtzdwltsin0xxggck2bneofh2pr/vo/cri/xtgfh9d8zsmfy vi5mvadyyfwpho4fcqeneycx/k1jftlsnmwwqygnjxmnmf5ny36yiq2ftlkfchtsd+idehxpxjut v4yys+qneycx/k1jfv+qxluqymdijxmnmf5ny37/kms7qmjnyictjzh+twn+ot2lxrlmeoesmz+b qzlxwlz7veztrnp7hv3jj2fys5nicxquxgh6/79fdhzyracpugmf+ec/ztewo8yh8+0tzpu80orl ker+bd/guww7dz2bbbgbxj1z0hojpc4p49y3jxmnmf5ny377cknyydkf4kp854vebonogwbvnqw0 aohfgca1qkcqs0pau1ki3tfezaeuviswrgldwltsin0xxs2hllyrfkyjq8c7uojdmv7nos5wkxzg cupau1ki3tfezaeuviswrgldwltsin0xxtz6ihl3lsgmaegkretqevyneycx/k1jfui7tunwkuq0 x8cezxwg6v6nh6tvjnscrupau1ki3tfej7y1yu+fhhbzqwdbqb1e1iodsy1wep73c6lg20g9rnsn ux8jbjt6hrp5c9fnhtxfljvmh/ptlc5khxzktuh3cjy7zifz7s3o/sutzgsto8vofeuxjioz0ptt sztepvnqqduunolyhru/xw4wwewgj4d+4b+doi9iv18oflhfoi+a/uafntovyr9fdhzyracpcq4g jlabmkdzqwdbqb1e1kdthynunpqgz7rbmgdnrsy= 

i think there informations in xml.

do have documentation how format xml call getavailability() function ?

the xml more in opinion :

<request>        <origin>bom</origin>     <destination>blr</destination>     <departdate>2015-05-15</departdate>     <returndate>2015-05-20</returndate>     <adultpax>1</adultpax>     <childpax>1</childpax>     <infantpax>1</infantpax>     <currency>inr</currency>     <preferredclass>b</preferredclass>     <mode>round</mode>      <clientid>7xxx</clientid>     <clientpassword>xx</clientpassword>     <clienttype>xxx</clienttype>     <preferredairline>ai,g8,ic,6e</preferredairline> </request> 

to read xml response, :

$values_array = json_decode(json_encode((array)simplexml_load_string($values)),1); 

there no simple way print data in html table because reponse multidimensionnal array. check how create html table php array? see how parse array print html table.


Comments