building a php object equal to xml tag

Athushi

New Member
i am developing an app in php it pulls data from Reuters API i am trying to add the request parameters before making SOAP call , i have the xml which must be generated from my request it must look like this :\[code\]<HeadlineMLRequest><Filter><MetaDataConstraint class="companies" xmlns="http://schemas.reuters.com/ns/2006/04/14/rmds/webservices/news/filter"><Value>MSFT.O</Value></MetaDataConstraint></Filter></HeadlineMLRequest>\[/code\]when i build my request parameter object i tried this\[code\]protected function getRequest() {$retval->HeadlineMLRequest->MaxCount = 10;$retval->HeadlineMLRequest->Filter->MetaDataConstraint->class = "companies";$retval->HeadlineMLRequest->Filter->MetaDataConstraint->Value = "http://stackoverflow.com/questions/12725122/MSFT.O";return $retval;}\[/code\]but when i echo last xml request i find it like this\[code\]<ns1:headlinemlrequest><ns1:maxcount> 10</ns1:maxcount><ns1:filter> <ns2:metadataconstraint class="companies"> <ns2:value> </ns2:value> </ns2:metadataconstraint></ns1:filter>\[/code\]if you notice Value is empty although i set it with "MSFT.O" , any help please?
 
Back
Top