views:

82

answers:

1

I need to generate the following XML with SOAP:

<MetaDataConstraint class="topics">
     <Value>FRX</Value>
</MetaDataConstraint>

I am not sure how to generate the attributes.

Based on: http://stackoverflow.com/questions/2045850/using-soap-to-generate-xml-attributes-in-php, I tried to do the following, but unfortunatelly it does not work.

$myFilter = array("MetaDataConstraint" => array("_" => array("Value" => "FRX")), "class" => "topics");

How can I solve it ?

A: 

Try:

$obj = new stdClass();
$obj->class = "topics";
$obj->Value = "FRX";
$myfilter = $obj;
benjy