I am very new to PHP. I am working on a project that makes a soap client request to a WSDL created from java and returns the response from the java program as List. I want to access the string from the returned array object in php, but am not able to do so.
Please find the code that I have used below -
$client = new SoapClient("http://rakesh-pc:8080/WikiEdit/wikiSearchService?wsdl");
$user = $_SESSION['user'];
$params = array(
"arg0" => $user,
);
$result = $client->wikiFind($params);
var_dump($result);
I am getting the following var_dump result for my program. Sorry, if it is not properly formatted.
object(stdClass)[2]
public 'return' =>
array (size=41)
0 => string '<http://en.wikipedia.org/wiki/Anarchism>' (length=40)
1 => string '<http://en.wikipedia.org/wiki/Red_and_Anarchist_SkinHeads>' (length=58)
2 => string '<http://en.wikipedia.org/wiki/Red_and_Anarchist_Skinheads>' (length=58)
3 => string '<http://en.wikipedia.org/wiki/Anti-statism>' (length=43)
4 => string '<http://en.wikipedia.org/wiki/Anarcho-capitalism>' (length=49)
5 => string '<http://en.wikipedia.org/wiki/Anarcho-Capitalism>' (length=49)
6 => string '<http://en.wikipedia.org/wiki/Individualist_anarchism>' (length=54)
7 => string '<http://en.wikipedia.org/wiki/Individualist_Anarchism>' (length=54)
....
I have tried several ways. The thing which is confusing me is that if I give count($result->return) to access the object, it is giving 41, which is correct. But if I try the same thing to display the string using echo $result->return[$i] in a while loop, I am getting only a blank page
This may sound trivial to some of you guys here, but I have been struggling with it from yesterday. Any help would be appreciated.