/** * Private method: make the request * */ private function _request($data, $replace = array(), $attribs = array()) { if (is_array($data)) { $atx = new ArrayToXML($data, $replace, $attribs); $xml = $atx->getXML(); } else { //assume raw xml otherwise, we need this because we have to build // our own sometimes because assoc arrays don't support same name keys $xml = $data; } $fields = array("jsessionid" => isset($this->_jsessionid) ? $this->_jsessionid : '', "xml" => $xml); $response = $this->_httpPost($fields); if ($response) { $arr = ArrayToXML::xml2array($response); if (isset($arr["Envelope"]["Body"]["RESULT"]["SUCCESS"])) { return $arr; } else { //throw new \Exception("HTTP Error: Invalid data from the server"); } } else { //throw new \Exception("HTTP request failed"); } }