SoapClient to DOMDocument

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
8BitHack
Forum Newbie
Posts: 1
Joined: Sat Feb 11, 2006 7:28 am
Location: Philadelphia

SoapClient to DOMDocument

Post by 8BitHack »

Heya folks,

I'm in a bit over my head with a project and I am hopeing some of the fine folks here could help me out. I'm trying to get a response from a soap call into a domdocument. I'm working with php 5.1, and the SoapClient and DOMDocument classes seem rather straight forward, but I'm haveing a spot of trouble.

here is the nuts and bolts of what I'm working with.

Code: Select all

$client = new SoapClient($wsdlurl, $params);

$result = $client->SoapFunction($paramsArray);

$dom = new DOMDocument();
$dom->loadXML($client->__getLastResponse());

echo $dom->saveXML();// Prints out exactly what it should

$dom->validate(); //gives me a 'no DTD found!'

$nodz = $dom->getElentsByTagName('TagName');

foreach($nodz as $node){
echo $node->nodeValue;//echos out nothing
}

so even thought the soap call seems to give me what I'm looking for, and even though I can load the string into the dom and then echo it to screen, I can't actually access any of it useing the typical dom methods.

Thanks for any help you can offer.
Post Reply