Parsing SoapClient Response with PHP
Good afternoon and Happy Thanksgiving to all!
I am a new member of this board and this is my first post. :-)
I am not new to PHP development, but fairly new to parsing SOAP objects, so here's my story:
I have successfully built a SoapClient, which returns an object as expected:
$client = new SoapClient ("https://pathtowsdl.asmx?wsdl",array("trace"=>1,'encoding'=>'utf-8'));
$response = $client -> SearchKBArticlesUnderFolder($params);
Below is a sample of the var_dump of the returned object with some of the actual data replaced with dummy values:
object(stdClass)#2 (1) {
["SearchKBArticlesUnderFolderResult"]=>
object(stdClass)#3 (4) {
["Articles"]=>
object(stdClass)#4 (1) {
["KBArticlesResultPart"]=>
array(3) {
[0]=>
object(stdClass)#5 (5) {
["BodySnippet"]=>
string(509) "long string value"
["KBArticleID"]=>
int(381)
["Relevance"]=>
float(100)
["Subject"]=>
string(95) "another string value..."
["Url"]=>
string(93) "https://urltoarticle.aspx"
My question / problem is this:
I cannot successfully parse the object so I can display individual elements in a results page.
I have tried various ways to do this, but I'm really not having a lot of luck.
Any pointers to other articles, list of steps, etc. would be greatly appreciated.