here is an example of the XML data:
Code: Select all
<NewDataSet>
<Table>
<I>11111</I>
<Q>741</Q>
<P>25.00</P>
<C>25.00</C>
</Table>
<Table>
<I>222222</I>
<Q>876</Q>
<P>12.00</P>
<C>12.00</C>
</Table>
</NewDataSet>
Here is the code:
Code: Select all
//SOAP it up
$param = array('this' => ****, 'that' => ****, 'other' => ****, 'stuff' => '');
$server = "http://www.someurl.com/updates.asmx?WSDL";
$client = new SoapClient($server);
$result = $client->Updater($param);
$xml = $result->UpdaterResult;
$xml = $xml->any;
//Put the XML into a usable array
$doc = new DOMDocument();
if(!$doc->loadXML($xml)){echo "doh!";}
foreach ($doc->getElementsByTagName('Table') as $node) {
$ssi[$node->getElementsByTagName('I')->item(0)->nodeValue] = array (
'q' => $node->getElementsByTagName('Q')->item(0)->nodeValue,
'p' => $node->getElementsByTagName('P')->item(0)->nodeValue,
'c' => $node->getElementsByTagName('C')->item(0)->nodeValue
);
}