I am trying to generate the following XML in my SOAP call:
<CResponse>
<ID>int</ID>
<Response Action="Apply">
<Question ID="$someint">
<Responses>
<Response ID="$someotherint" />
<Response ID="$yetanotherint" />
</Responses>
</Question>
</Response>
</CResponse>
I can create most of the call just fine - I've finally picked up that nested arrays are my friends - but I have no idea how to add those ID="$int"
and Action="Apply"
attributes to the various tags. I'm sure this is fairly easy, but I just can't figure it out.
TIA.
You should be able to add attributes with following syntax:
array("foo" => array("_" => "cheese", "bar"=>"moo"));
This should produce following XML
<foo bar="moo">cheese</foo>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With