使用SOAP来生成PHP的XML属性
问题描述:
我需要生成以下XML与SOAP:
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.
根据http://stackoverflow.com/questions/2045850/using-soap-to-generate-xml-attributes-in-php,我试着做以下,但可惜的是它不工作。
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 =阵列(MetaDataConstraint=>阵列(_=>阵列(值=>FRX)),
阶级=>主题);
$myFilter = array("MetaDataConstraint" => array("_" => array("Value" => "FRX")), "class" => "topics");
我该如何解决呢?
答
尝试:
$obj = new stdClass();
$obj->class = "topics";
$obj->Value = "FRX";
$myfilter = $obj;