Using a PHP5 SOAP client with DirectFlight


#1

I’m attempting to use PHP5’s SOAP support with DirectFlight, but when I try to create the SOAP client as follows:


$wsdlDirectFlight = "http://flightaware.com/commercial/directflight/data/wsdl1.xml";

$DirectFlight_Authentication = array(
    'user'          => 'myusername',
    'pass'          => 'mydirectflightkey'
);

$client = new SoapClient($wsdlDirectFlight, $DirectFlight_Authentication);


I get this exception:

SOAP-ERROR: Parsing Schema: attribute ‘http://schemas.xmlsoap.org/soap/encoding/:arrayType’ already defined

Any ideas, anyone?

Thanks!


#2

Is there any way to get slightly more verbose debugging that indicates a line number in the WSDL where the parser has an error?


#3

Unfortunately, it seems I can only get it to give me the line number of the PHP code from which I try to create the SOAP client, but no more details on the parsing problem.

Looking at the possible parameters (http://us3.php.net/manual/en/function.soap-soapclient-construct.php), I’ve tried a few other variations (such as soap_version SOAP_1_1 and SOAP_1_2), but it has not made a difference.


#4

Got it. If you google for the problem, lots of people have weird, unexplained problems parsing WSDL with PHP5’s native SOAP functionality. Can you use PEAR-SOAP? That’s part of DirectFlight’s test suite here at FlightAware and is a popular library that lots of other customers are using.


#5

I’ve just tried PEAR SOAP, and it seems to work fine. Now on to the fun part! Thanks for your help.