/** * For SOAP - Post Order Directly to Presswise * * @access public * @return void */ public function postSoapOrder() { return; try { $oAuth = $this->_getSoapAuthObj(); $aItem = $this->_getSoapItemObj(); $oSoapAuthObj = new SoapVar($oAuth, SOAP_ENC_OBJECT, "auth"); $oSoapOrderObj = new SoapVar($aItem, SOAP_ENC_OBJECT, "data"); $client = new SoapClient(NULL, array('location' => PRESSWISE_ENDPOINT, 'trace' => true, 'encoding' => 'ISO-8859-1', 'uri' => "http://test-uri/")); $result = $client->add_purchase_order($oSoapAuthObj, $oSoapOrderObj); if ($result['result']['status']['code'] != 0) { $this->isErrors = true; $this->_errors['API Error'] = $result['result']['status']['text']; } } catch (Exception $e) { PresswiseDb::logError($e); $this->isErrors = true; $this->_errors = $e->getMessage(); return false; } }
/** * PHP Script that Instantiates the Presswise Process * * @package Presswise * @author gWilli * @version 1.0 * @name Controller Action * @copyright 2013 * @uses Constants */ spl_autoload_register(function ($sClass) { $sClass = str_replace("_", DIRECTORY_SEPARATOR, $sClass); if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . $sClass . '.php')) { require_once __DIR__ . DIRECTORY_SEPARATOR . $sClass . '.php'; } }); // See if Process is Already Running $pid = new Pid('/tmp', basename(__FILE__)); if (!$pid->already_running) { try { $oPresswiseProcess = new ProcessPresswise(); $oPresswiseProcess->processSoap(); PresswiseDb::getInstance()->updatePrintedOrders(); if ($oPresswiseProcess->ordersProcessed() > 0) { PresswiseDb::getInstance()->logProcessResults($oPresswiseProcess->ordersProcessed(), $oPresswiseProcess->errorCount(), $oPresswiseProcess->getReport()); } } catch (Exception $e) { PresswiseDb::logError($e); } } return 1;