function call($methodName, $params = null) { try { OX_M2M_M2MProtectedRpc::dumpCall($this->serviceExecutor, $methodName, $params); $fullParams = $this->addCredentials($params); $result = $this->serviceExecutor->call($methodName, $fullParams); OX_M2M_M2MProtectedRpc::dumpResult($this->serviceExecutor, $methodName, $params, $result); return $result; } catch (Exception $e) { //echo "<BR><BR>" . $e->getTraceAsString() . "<BR><BR>"; if ($e->getCode() == OX_M2M_XmlRpcErrorCodes::$TICKET_EXPIRED) { $this->m2mTicketProvider->getTicket(true); return $this->call($methodName, $params); } throw $e; } }
function call_($methodName, $params, $accountId, $accountType, $credentials = null) { try { if ($credentials === null) { $credentials = $this->getCredentialsParam($accountId, $accountType); } OX_M2M_M2MProtectedRpc::dumpCall($this->serviceExecutor, $methodName, $params); $fullParams = array_merge(array($credentials), $params); $result = $this->serviceExecutor->call($methodName, $fullParams); OX_M2M_M2MProtectedRpc::dumpResult($this->serviceExecutor, $methodName, $params, $result); return $result; } catch (Exception $e) { //echo "<BR><BR>" . $e->getTraceAsString() . "<BR><BR>"; if ($e->getCode() == OX_M2M_XmlRpcErrorCodes::$TICKET_EXPIRED) { $this->getM2MTicket($accountId, $accountType); } else { if ($e->getCode() == OX_M2M_XmlRpcErrorCodes::$PASSWORD_EXPIRED) { $this->reconnectM2M($accountId, $accountType); } else { if ($e->getCode() == OX_M2M_XmlRpcErrorCodes::$PASSWORD_INVALID && $accountId != $this->m2mDataProvider->getAdminAccountId()) { //if password invalid try regenerate using admin password $this->connectM2M($accountId, $accountType); } else { throw $e; } } } return $this->call_($methodName, $params, $accountId, $accountType); } }