I'm taking my response from a Soap Request, and passing it into a new SimpleXML construct.
$response = $this->client->$method(array("Request" => $this->params)); $response_string = $this->client->__getLastResponse(); $this->response = new Classes_Result(new SimpleXMLElement($result)); If I echo the $response_string, it outputs a proper xml string. Here is a snippet as it's quite long.
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body><GetClassesResponse xmlns="http://clients.mindbodyonline.com/api/0_5"> <GetClassesResult> <Status>Success</Status> <XMLDetail>Full</XMLDetail> <ResultCount>6</ResultCount> <CurrentPageIndex>0</CurrentPageIndex> <TotalPageCount>1</TotalPageCount> <Classes> <Class> <ClassScheduleID>4</ClassScheduleID> <Location> <SiteID>20853</SiteID> ....</soap:Envelope> Hoever, when I try to work with this object, I get errors or if I dump the object it outputs:
object(SimpleXMLElement)#51 (0) Any ideas why this might be happening?
Classes_Result? is it equivalent tovar_dump? you should echo /var_dump($result)instead.