12345 Wherein: array...">

Using SOAP to generate XML attributes in PHP

I found that you can generate this in SOAP in php:

<foo bar="blah">12345</foo> 

Wherein:

 array("foo" => array("_" => 12345, "bar" => "blah")); 

However, the underscore method does not seem to work when the value is not a number and a string, but is instead implemented with xml code. How do you do this, for example?

 <foo bar="blah"> <aaa a="b">blah</aaa> </foo> 

This is an extension of this question: http://www.bigresource.com/Tracker/Track-php-uQwDoUib/

+4
source share
2 answers

I don't have a quick way to test, but maybe this will work:

 $a = array( 'foo' => array( 'bar' => 'blah', 'aaa' => array( '_' => 'blah', 'a' => "b", ), ), ); 
+11
source

How can you add an attribute to a node, which is a function;

 $update = $soap->UpdateMember($pRecord); 

or

 $update = $soap->__soapCall('UpdateMember', array($Updates)); 

I need to add the namescape or xmlns attribute to the name of the actual function here. I get the following;

 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sample.net/"> <SOAP-ENV:Body> <ns1:UpdateMember> MORE XML HERE </ns1:UpdateMember> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

but i need

 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sample.net/"> <SOAP-ENV:Body> <ns1:UpdateMember xmlns="http://www.sample.net/"> MORE XML HERE </ns1:UpdateMember> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

You need to have ns1: UpdateMember xmlns: ns1 = "http://www.sample.net/" or something like that.

0
source

All Articles