/** * Process and return the results of an asyncrhonous SoftLayer API call * * Read data from our socket and process the raw SOAP result from the * SoapClient instance that made the asynchronous call. wait() * *must* be called in order to recieve the results from your API call. * * @return object */ public function wait() { $soapResult = ''; while (!feof($this->_socket)) { $soapResult .= fread($this->_socket, 8192); } // separate the SOAP result into headers and data. list($headers, $data) = explode("\r\n\r\n", $soapResult); return $this->_soapClient->handleAsyncResult($this->_functionName, $data); }