I've seen this question answered elsewhere but I still can't make it work, so I need some further clarification:
The example given was:
$tag['_'] = 'yyy';
$tag['attr'] = 'xxx';
$tagVar = new SoapVar($tag, SOAP_ENC_OBJECT);
The generated xml would be:
<tag attr="xxx">yyy</tag>
However, I'm getting
<tag>
<_>yyy</_>
<attr>xxx</attr>
</tag>
So, is anything else needed to make it work as expected? Some kind of configuration in the SoapServer class or in the WSDL even?
To complicate things a bit more, the element is namespaced, so actually I'm looking for a way to get
<ns:tag attr="xxx">yyy</ns:tag>