tags:

views:

993

answers:

1

Hi all,

I'm trying to build an interface to https://ws.farebuzz.com/FlightGateway.asmx?WSDL using php and SoapClient class.

I managed to get over the authentication header but I'm stuck when I try to call a method .. I'm always getting :

Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Object reference not set to an instance of an object.

I tried calling it like this (as an object) :

class SearchFlights{
    public $NumberOfAdults;
        public $ClassOfService;
    public $TypeOfTrip;
    public $FromCity;
    public $ToCity;
}

$parameters = new SearchFlights();
$parameters->NumberOfAdults = 2;
$parameters->ClassOfService = 'ECONOMY';
$parameters->FromCity = 'ECONOMY';
$parameters->ToCity = '1te';
$parameters->TypeOfTrip = 'NONE';
$this->client->SearchFlights($parameters);

and as an array like :

$parameters = array('ToCity' => 'testttt',...);

but I got same error. Can anyone help?

Thanks

Sorin

A: 

Try using this:

$this->client->SearchFlights(array('parameters' => $parameters));

I was having problems trying to access a .net webservice and this solved it for me.

wajiw