PHP and PEAR SOAP: How to pass attributes to a webservice operation (xml-wsdl)

Basing a PHP SOAP Client on a webservice’s WSDL is very easy using PEAR’s SOAP package.

Usually you can pass tons of XML ELEMENTS to the webservice. But how to pass XML ATTRIBUTES?

 

Sample XML REQUEST structure:

<airline id=”12”>Air Congo<airline>

 

With PHP PEAR SOAP I was thinking to use it this way:

 

$params = array(“airline" “ => array(“_” => “Air Congo”, “id” => “12”));

$result = $client->getAirline($params);

 

… but unfortunatelly this doesn’t work …

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top