How to get a nicely formatted PHP Web Service response?
- by Bruno
I called an API like this:
$service = new Class_Service();
$parameters = new GetClasses();
$parameters->Request = new GetClassesRequest();
$parameters->Request->SourceCredentials = new SourceCredentials();
$parameters->Request->SourceCredentials->SourceName = "Name";
$parameters->Request->SourceCredentials->Password = "Pass";
$parameters->Request->SourceCredentials->SiteIDs = array(
12
);
$classes = $service->GetClasses($parameters);
var_dump($classes);
And received a response like this:
object(GetClassesResponse)#7 (1) {
["GetClassesResult"]=>
object(GetClassesResult)#8 (6 {
["Classes"]=>
object(stdClass)#9 (1) {
["Class"]=> array(25) {
[0]=> object(Mi_Class)#10 (21) {
["ClassScheduleID"]=> int(15)
["Visits"]=> NULL
["Clients"]=> NULL
["Location"]=> object(Location)#11 (30) {
["BusinessID"]=> NULL
["SiteID"]=> int(12)
["BusinessDescription"]=> NULL
["AdditionalImageURLs"]=> object(stdClass)#12 (0) { }
["FacilitySquareFeet"]=> NULL
Does a response normally look like this?
How do I go about getting the data in a formatted manner?