public function __construct() { $this->db =& $GLOBALS['phpgw']->db; $location_id = $GLOBALS['phpgw']->locations->get_id('admin', 'vfs_filedata'); $c = CreateObject('admin.soconfig', $location_id); $section = 'braArkiv'; $location_url = $c->config_data[$section]['location_url']; //'http://braarkiv.adm.bgo/service/services.asmx'; $braarkiv_user = $c->config_data[$section]['braarkiv_user']; $braarkiv_pass = $c->config_data[$section]['braarkiv_pass']; if (!isset($c->config_data) || !$c->config_data) { $this->config = $c; $this->init_config(); } if (!$location_url || !$braarkiv_pass || !$braarkiv_pass) { throw new Exception('braArkiv is not configured'); } $wdsl = "{$location_url}?WSDL"; $options = array(); $options[Bra5WsdlClass::WSDL_URL] = $wdsl; $options[Bra5WsdlClass::WSDL_ENCODING] = 'UTF-8'; $options[Bra5WsdlClass::WSDL_TRACE] = false; $options[Bra5WsdlClass::WSDL_SOAP_VERSION] = SOAP_1_2; try { $wsdlObject = new Bra5WsdlClass($options); } catch (Exception $e) { if ($e) { phpgwapi_cache::message_set($e->getMessage(), 'error'); return false; } } $bra5ServiceLogin = new Bra5ServiceLogin(); if ($bra5ServiceLogin->Login(new Bra5StructLogin($braarkiv_user, $braarkiv_pass))) { $this->secKey = $bra5ServiceLogin->getResult()->getLoginResult()->LoginResult; } else { throw new Exception('vfs_fileoperation_braArkiv::Login failed'); } }
* $wsdl[Bra5WsdlClass::WSDL_TRACE] = true; * $wsdl[Bra5WsdlClass::WSDL_LOGIN] = 'myLogin'; * $wsdl[Bra5WsdlClass::WSDL_PASSWD] = '**********'; * etc.... * Then instantiate the Service class as: * - $wsdlObject = new Bra5WsdlClass($wsdl); */ /** * Examples */ /****************************** * Example for Bra5ServiceLogin */ $bra5ServiceLogin = new Bra5ServiceLogin(); // sample call for Bra5ServiceLogin::Login() if ($bra5ServiceLogin->Login(new Bra5StructLogin())) { print_r($bra5ServiceLogin->getResult()); } else { print_r($bra5ServiceLogin->getLastError()); } /******************************* * Example for Bra5ServiceLogout */ $bra5ServiceLogout = new Bra5ServiceLogout(); // sample call for Bra5ServiceLogout::Logout() if ($bra5ServiceLogout->Logout(new Bra5StructLogout())) { print_r($bra5ServiceLogout->getResult()); } else { print_r($bra5ServiceLogout->getLastError()); } /****************************
ini_set('display_errors', true); error_reporting(-1); /** * Load autoload */ require_once PHPGW_API_INC . '/soap_client/bra5/Bra5Autoload.php'; $wdsl = "{$location_url}?WSDL"; $options = array(); $options[Bra5WsdlClass::WSDL_URL] = $wdsl; $options[Bra5WsdlClass::WSDL_ENCODING] = 'UTF-8'; //$options[Bra5WsdlClass::WSDL_CACHE_WSDL] = WSDL_CACHE_NONE; $options[Bra5WsdlClass::WSDL_TRACE] = false; $options[Bra5WsdlClass::WSDL_SOAP_VERSION] = SOAP_1_2; $wsdlObject = new Bra5WsdlClass($options); $bra5ServiceLogin = new Bra5ServiceLogin(); if ($bra5ServiceLogin->Login(new Bra5StructLogin($braarkiv_user, $braarkiv_pass))) { $secKey = $bra5ServiceLogin->getResult()->getLoginResult()->LoginResult; } else { print_r($bra5ServiceLogin->getLastError()); } if ($fileid) { $bra5ServiceGet = new Bra5ServiceGet(); if ($bra5ServiceGet->getFileAsByteArray(new Bra5StructGetFileAsByteArray($secKey, $fileid))) { $file_result = $bra5ServiceGet->getResult()->getFileAsByteArrayResult; $file = base64_decode($file_result->getFileAsByteArrayResult); /* $bra5ServiceGet->getFileName(new Bra5StructGetFileName($secKey, $fileid)); $filename = $bra5ServiceGet->getResult()->getFileNameResult->getFileNameResult; */ $browser = CreateObject('phpgwapi.browser'); $browser->content_header("{$fileid}.pdf", 'application/pdf');