Jump to content

PHP 5 and SOAP attributes...


Raphael diSanto

Recommended Posts

Hey y'all.. New to the form, been hacking at PHP since the late 90s, but.. Definitely new to SOAP..

 

So, I need to formulate a SOAP request that looks like this:

 

<mynode foo="bar">Stuff</mynode>

 

Using PHP5's built in SOAP routines..

 

Did some digging online and I found this array structure to pass in:

 

array(
"mynode" => array(
	"_" => "Stuff",
	"foo" => "bar"
)
);

 

(It was from a user-posted comment on the SOAP documentation page on the official PHP docs site)

 

... 'cept, when I do that, I get this:

 

<mynode>
<item>
	<key>_</key>
	<value>Stuff</value>
</item>
<item>
	<key>foo</key>
	<value>bar</value>
</item>
</mynode>

 

.... which is ... less than helpful. Is there some kind of option I should be passing the SoapClient when I'm instantiating it?

 

Any help would be much appreciated! Thanks!

Link to comment
https://forums.phpfreaks.com/topic/175113-php-5-and-soap-attributes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.