Exemple #1
0
 /**
  *
  */
 public function loadXML($response)
 {
     $valid = true;
     if (extension_loaded('WebServices')) {
         if (!is_string($response)) {
             $this->_fault = new Zend_XmlRpc_Fault(650);
             $this->_fault->setEncoding($this->getEncoding());
             return false;
         }
         try {
             $xml = @new SimpleXMLElement($response);
         } catch (Exception $e) {
             // Not valid XML
             $this->_fault = new Zend_XmlRpc_Fault(651);
             $this->_fault->setEncoding($this->getEncoding());
             return false;
         }
         if (!empty($xml->fault)) {
             // fault response
             $this->_fault = new Zend_XmlRpc_Fault();
             $this->_fault->setEncoding($this->getEncoding());
             $this->_fault->loadXml($response);
             return false;
         }
         if (empty($xml->params)) {
             // Invalid response
             $this->_fault = new Zend_XmlRpc_Fault(652);
             $this->_fault->setEncoding($this->getEncoding());
             return false;
         }
         $value = rpc_decode($response);
         $this->setReturnValue($value);
     } else {
         $valid = parent::loadXML($response);
     }
     return $valid;
 }