Could you clarify which version of PHP you are using (4 or 5)? There is also a special reason why you do not want / cannot use the PHP 5 SOAP extension? Knowing this information should help us give you a better answer.
, , , oproduct. node SOAP, oproduct "http://v3.core.com.productserve.com/". XPath. , :
$xml = simplexml_load_string($response);
$xml->registerXPathNamespace('ns', 'http://v3.core.com.productserve.com/');
foreach ($xml->xpath('//ns:oproduct') as $item)
{
}
, .
. , , , , :
$xml = simplexml_load_string($response);
$xml->registerXPathNamespace('soapenv', 'http://schemas.xmlsoap.org/soap/envelope/');
$xml->registerXPathNamespace('ns', 'http://v3.core.com.productserve.com/');
foreach ($xml->xpath('/soapenv:envelope/soapenv:body/ns:getproductlistresponse/ns:oproduct') as $item)
{
}
, node -Env: body oproduct . , .
:
, . :
$xml = simplexml_load_string($response);
$ns = $xml->getNamespaces(true);
$soap = $xml->children($ns['soap-env']);
$getproductlistresponse = $soap->body->children($ns['ns1']);
foreach ($getproductlistresponse->children() as $item)
{
echo (string) $item->iid . '<br />';
}
, . XPath, XPath. , - XPath?