0

I'm curremtly working on a project "Flight search" with SOAP and PHP. I'm new to this SOAP Technology.

I've to send the XML over POST Request and get the response:

<Request>
<Origin>BOM</Origin>
<Destination>DEL</Destination>
<DepartDate>2013-05-20</DepartDate>
<ReturnDate>2013-05-21</ReturnDate>
<AdultPax>1</AdultPax>
<ChildPax>0</ChildPax>
<InfantPax>0</InfantPax>
<Currency>INR</Currency>
<Clientid>*********</Clientid>
<Clientpassword>**************************</Clientpassword>
<Clienttype>ArzooFWS1.1</Clienttype>
<Preferredclass>E</Preferredclass>
<mode>ONE</mode>
<PreferredAirline>AI</PreferredAirline>
</Request>

to the URL:

http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl

Can any one please help ? I'm struggling with this. Thanks in advance.

EDIT: I'm trying the following but its getting error:

$dom_document = simplexml_load_file("availability.xml");

    try{
        $soap_client =
            new soapclient("http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl");
        $availability = $soap_client->getAvailability($dom_document);
        echo $availability->getAvailabilityResponse;
    }catch(SoapFault $exception){
        echo $exception->getMessage();
    }

The error i'm getting:

Notice: Trying to get property of non-object in
C:\xampp\htdocs\Flight\availability.php on line 9

3
Contributors
8
Replies
33
Views
4 Years
Discussion Span
Last Post by rayidi
0

ANy chance that you could enter the url of the wsdl? We could then try to replicate the issue.

Is this a valid method call?

$soap_client->getAvailability($dom_document);

Don't you have to encode and escape the XML before sending?

Edited by diafol

2

It's SoapClient, NOT soapclient

I thought classnames were case-insensitive?

Votes + Comments
Indeed.
0

I agree. That another mess with php :( CSensitivity for some things, but not others. You'd think they'd get their act together by v5.4 :) Well I suppose they break the net with that one though.

0

Tried with SoapClient instead of soapclient but no change on the error..

I used __getFunctions for getting the function name and it returned array(1) { [0]=> string(35) "string getAvailability(string $in0)" }

0

OK, so you know that you have to supply a string $in0. In what format is the string expected?

Check the actual url:

http://xx.xxx.xx.xxx/ArzooWS/services/DOMFlightAvailability?wsdl 

And you should get all the relevant info as to how to make a valid request.
Search the tree for $in0 if present.
Passing the parameter, you may need to place it in an array though.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.