imanewbe Posted January 31, 2013 Share Posted January 31, 2013 I am working with a soap client. What I need to do is create the xml <soapenv:Body> <req:FareSearchRQ> <req:Date req:Qualifier="DEPARTURE">2013-12-07</req:Date> </req:FareSearchRQ> </soapenv:Body> but I am having trouble. I can either get <req:Date>2013-12-07</req:Date> or <req:Date req:Qualifier="DEPARTURE"/> In my php code to get this I create an array with like this $params = array( 'FareSearchRQ' => array( "Date" => array("Qualifier" => "DEPARTURE") ) ); //This creates the first $params = array( 'FareSearchRQ' => array( "Date" => "2013-12-07" ) ); //This creates the second How would I create an array to create the xml shown above? Link to comment https://forums.phpfreaks.com/topic/273881-soapclient-xml-help/ Share on other sites More sharing options...
imanewbe Posted February 1, 2013 Author Share Posted February 1, 2013 I found the answer here: http://www.php.net/m...var.soapvar.php in the first comment I needed to do this: $params = array( 'FareSearchRQ' => array( "Date" => array("Qualifier" => "DEPARTURE", "_" => "2013-12-07") ) ); Link to comment https://forums.phpfreaks.com/topic/273881-soapclient-xml-help/#findComment-1409412 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.