Page 1 of 1

Parsing SOAP response

Posted: Mon May 20, 2013 5:49 pm
by Steve Kucera
Hello,

I am working on a project and I need to parse the repsonse object from a SOAP request. I am successfully making the call and getting the following object from this response:

$response = $result->GetOrderListRecentResult;
var_dump($response); )

THIS IS THE OBJECT PER THE var_dump COMMAND

object(stdClass)#4 (1) {
["OrderList"]=>
array(3) {
[0]=>
object(stdClass)#5 (5) {
["RequestID"]=>
int(0)
["Success"]=>
int(1)
["OrderID"]=>
int(11510)
["CreatedDate"]=>
string(22) "2013-05-20T19:03:17.19"
["LastModifiedDate"]=>
string(23) "2013-05-20T19:03:17.377"
}
[1]=>
object(stdClass)#6 (5) {
["RequestID"]=>
int(0)
["Success"]=>
int(1)
["OrderID"]=>
int(11509)
["CreatedDate"]=>
string(22) "2013-05-20T18:11:17.08"
["LastModifiedDate"]=>
string(23) "2013-05-20T18:11:17.213"
}
[2]=>
object(stdClass)#7 (5) {
["RequestID"]=>
int(0)
["Success"]=>
int(1)
["OrderID"]=>
int(11508)
["CreatedDate"]=>
string(23) "2013-05-20T18:00:43.457"
["LastModifiedDate"]=>
string(22) "2013-05-20T18:00:43.58"
}
}
}


What I need to do is extract the OrderID(s) from the object to insert them into a database. I know the MYSQL end of things but am pretty new at handling data objects. The scripting is written in PHP.

Thanks for any help.

Re: Parsing SOAP response

Posted: Tue May 21, 2013 3:13 pm
by Steve Kucera
Problem solved.