Reputation: 39
i am calling a soap based web service in php.
when i echo the output nothing can be seen on the page, but i can see a xml in viewsouce. Can anyone guide me in processing the output so that i can appropriate data from it. I have never dealt with xml before so finding it a bit confusing.
Here's my code
$a = new SoapClient('http://abc.com?wsdl');
$login = $a ->TestConnectStr(array('UserName' => 'Test', 'Password' => '1234'));
echo $login->TestConnectStrResult;
the output link view-source:http://www.toolbrands.co.uk/rialto.php
Thanks in advance
Upvotes: 0
Views: 174
Reputation:
The reason is that your given web service method $a ->TestConnectStr(); returns a XML string . if you print the resulted string using echo the browser will render the xml tags . if want the see xml out put for testing purpose you can print those values to a textarea like this
$xml= $login->TestConnectStrResult;
echo "< textarea cols=50 rows=10> $xml < /textarea> ";
if you need do any operations on resulted xml string you need to parse that xml
Upvotes: 1