/** * Login to Jira */ private function connect() { if (!empty($this->token)) { return; } $this->token = $this->soapClient->login($this->user, $this->password); }
/** * * @return SoapClient */ public function GetClient() { if (!isset(self::$SOAP_CLIENT)) { self::$SOAP_CLIENT = new \SoapClient(\MagentoConfigs::$WSDL_URL); $username = \MagentoConfigs::$USERNAME; $password = \MagentoConfigs::$API_KEY; self::$SESSION = self::$SOAP_CLIENT->login($username, $password); } return self::$SOAP_CLIENT; }
/** * start the session for soap * * @param string $apiUser * @param string $apiKey * * @return SoapClient */ protected function _connect() { if (($this->_session = trim($this->_session)) === '') { $this->_session = $this->_soapClient->login($this->_apiUser, $this->_apiKey); } return $this->_soapClient; }
public function actionTest() { $wsdlUrl = Yii::app()->request->hostInfo . $this->createUrl('user'); $client = new SoapClient($wsdlUrl); echo "<pre>"; echo "login...\n"; $client->login('admin', '1234qwe'); echo "fetching all contacts\n"; //echo $client->login('admin','1234qwe'); echo "<br/>"; print_r($client->getUsers()); //CVarDumper::dump($client->getUsers()); echo "<br/>"; echo Yii::app()->request->hostInfo . $this->createUrl('user'); echo "<br/>"; echo "\ninserting a new contact..."; $model = new sUser(); $model->username = '******'; $model->password = '******'; $model->salt = '1234qwe'; $model->default_group = 1; $model->status_id = 1; $model->created_date = time(); $model->created_by = "admin"; $client->saveUser($model); echo "done\n\n"; echo "fetching all contacts\n"; print_r($client->getUsers()); echo "</pre>"; }
function efJIRARender($input, $args, $parser) { global $JIRAs, $JIRAdefault; try { if (isset($args['jira'])) { $which = $args['jira']; } else { $which = $JIRAdefault; } $jira = new SoapClient($JIRAs[$which]['url']); $auth = $jira->login($JIRAs[$which]['user'], $JIRAs[$which]['password']); $info = $jira->getServerInfo($auth); $url = $info->baseUrl; if (isset($args['projects'])) { $projs = array_map('trim', explode(',', $args['projects'])); $issues = $jira->getIssuesFromTextSearchWithProject($auth, $projs, $input, 100); } else { $issues = $jira->getIssuesFromTextSearch($auth, $input); } $statuses = $jira->getStatuses($auth); $priorities = $jira->getPriorities($auth); $resolutions = $jira->getResolutions($auth); $fields = array('status' => $statuses, 'priority' => $priorities, 'resolution' => $resolutions, 'url' => $url); $s = "<table border='1' cellspacing='0'><tr><th>Key</th><th>Summary</th><th>Status</th><th>Pri</th><th>Res</th><th>Assignee</th></tr>"; foreach ($issues as $issue) { $s .= JIRAformatOneIssue($jira, $auth, $fields, $issue); } $s .= "</table>"; return $s; } catch (Exception $e) { return htmlspecialchars($e->getMessage()); } }
private function createTarget(Project $project) { $client = new SoapClient($this->wsdl_url); // Establish connection to the server $session_hash = $client->login($this->user_login, $this->user_password)->session_hash; $root_folder_id = (int) $client->getRootFolder($session_hash, $project->getID()); return (int) $client->createDocmanFolder($session_hash, $project->getID(), $root_folder_id, 'Docman v1 import', 'Documents imported from legacy documentation system on ' . date('c', $_SERVER['REQUEST_TIME']), 'begin', 'none', array(array('type' => DocmanV1_XMLExportData::V2_SOAP_PERM_NONE, 'ugroup_id' => ProjectUGroup::ANONYMOUS), array('type' => DocmanV1_XMLExportData::V2_SOAP_PERM_NONE, 'ugroup_id' => ProjectUGroup::REGISTERED), array('type' => DocmanV1_XMLExportData::V2_SOAP_PERM_NONE, 'ugroup_id' => ProjectUGroup::PROJECT_MEMBERS), array('type' => DocmanV1_XMLExportData::V2_SOAP_PERM_MANAGE, 'ugroup_id' => ProjectUGroup::PROJECT_ADMIN)), array(), 'admin', $_SERVER['REQUEST_TIME'], $_SERVER['REQUEST_TIME']); }
function sakai_login_valid($user, $pass) { //$host = 'localhost'; $login_wsdl = "http://localhost:8080/sakai-axis/SakaiLogin.jws?wsdl"; $script_wsdl = "http://localhost:8080/sakai-axis/SakaiMobileScriptC.jws?wsdl"; $login = new SoapClient($login_wsdl, array('exceptions' => 0)); $session = $login->login($user, $pass); $active = new SoapClient($script_wsdl, array('exceptions' => 0)); return array($active, $session); }
public function register(Application $app) { $app['database_connection'] = $app->share(function ($app) { $config = new Configuration(); $connectionParams = ['dbname' => 'app', 'user' => 'some_user', 'password' => 'some_password', 'host' => 'some_host', 'charset' => 'utf8']; return DriverManager::getConnection($connectionParams, $config); }); $app['entity_manager'] = $app->share(function ($app) { return EntityManager::create($app['database_connection'], Setup::createAnnotationMetadataConfiguration([__DIR__ . '/Entity/'])); }); $app['billing_service_client'] = $app->share(function ($app) { $soapClient = new \SoapClient(__DIR__ . "/../../config/billing-service.wsdl", ['features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'classmap' => $app['soap_classmap']]); $soapClient->__setLocation('http://192.168.99.100:81/api/64.0'); $result = $soapClient->login(['username' => '*****@*****.**', 'password' => 'vA71jAPgJFG83a7v']); $sessionKey = $result->result->Session; $sessionHeader = new SoapHeader('http://api.zuora.com/', 'SessionHeader', ['session' => $sessionKey]); $soapClient->__setSoapHeaders($sessionHeader); return $soapClient; }); $app['zuora_client'] = $app->share(function ($app) { $soapClient = new \SoapClient(__DIR__ . "/../../config/billing-service.wsdl", ['features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'classmap' => $app['soap_classmap']]); $soapClient->__setLocation('https://apisandbox.zuora.com/apps/services/a/64.0'); $result = $soapClient->login(['username' => '*****@*****.**', 'password' => 'vA71jAPgJFG83a7v']); $sessionKey = $result->result->Session; $sessionHeader = new SoapHeader('http://api.zuora.com/', 'SessionHeader', ['session' => $sessionKey]); $soapClient->__setSoapHeaders($sessionHeader); return $soapClient; }); $app['zuora_production_client'] = $app->share(function ($app) { $soapClient = new \SoapClient(__DIR__ . "/../../config/billing-service-read-only.wsdl", ['features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'classmap' => $app['soap_classmap']]); $soapClient->__setLocation('https://www.zuora.com/apps/services/a/64.0'); $result = $soapClient->login(['username' => '*****@*****.**', 'password' => 'rFBDQfJvPsDoN5r7']); $sessionKey = $result->result->Session; $sessionHeader = new SoapHeader('http://api.zuora.com/', 'SessionHeader', ['session' => $sessionKey]); $soapClient->__setSoapHeaders($sessionHeader); return $soapClient; }); $app['account_finder'] = $app->share(function ($app) { return new AccountFinder($app['zuora_client'], $app['entity_manager']); }); $app['replay'] = $app->share(function ($app) { return new Replay($app['entity_manager']->getRepository('\\Jimdo\\Payment\\Billing\\ReplayAndCompare\\Entity\\Log'), $app['zuora_client'], new IdFinder(new ZObjectRepository($app['zuora_production_client']), new ZObjectRepository($app['zuora_client']))); }); $app['compare'] = $app->share(function ($app) { return new Compare(new ObjectTree($app['zuora_production_client']), new ObjectTree($app['zuora_client']), new Differ(new Comparator([]))); }); $app['some_account'] = $app->share(function ($app) { return new SomeAccount($app['database_connection']); }); $app['product_catalog'] = $app->share(function ($app) { return new ProductCatalog($app['zuora_client']); }); $app->register(new MonologServiceProvider(), ['monolog.logfile' => 'php://stderr']); }
public function FTPinfos_serverTotalSpace($localhost_path, $manager_loggin, $manager_pass) { if ($_SERVER['SERVER_ADDR'] == '127.0.0.1') { return disk_total_space($localhost_path); } else { $soap = new \SoapClient("https://www.ovh.com/soapi/soapi-re-1.24.wsdl"); $session_soap = $soap->login($manager_loggin, $manager_pass, "fr", false); $result = $soap->hostingSummary($session_soap, preg_replace('/^www\\./', '', $_SERVER["SERVER_NAME"])); $soap->logout($session_soap); return intval($result->maxWebspace) / 1000 * 1024 * 1024 * 1024; } }
/** * Initialize the soap client with the local information. * * @throws InvalidCredentialException If given credentials are invalid * @throws RestCallException If Prestashop is not accessible. * @throws \SoapFault */ protected function connect() { try { $this->session = $this->client->login($this->clientParameters->getSoapUsername(), $this->clientParameters->getRestApiKey()); } catch (\SoapFault $e) { if (static::PRESTASHOP_BAD_CREDENTIALS === $e->faultcode) { throw new InvalidCredentialException(sprintf('Error on Prestashop SOAP credentials to "%s": "%s".' . 'You should check your login and Prestashop API key.', $this->clientParameters->getPrestashopUrl(), $e->getMessage()), $e->getCode(), $e); } elseif (static::PRESTASHOP_CLIENT_NOT_CALLABLE === $e->faultcode) { $lastResponse = $this->client->__getLastResponse(); echo "DEBUG: Last SOAP response: " . $lastResponse . "\n"; if (strlen($lastResponse) <= 200) { $truncatedLastResponse = htmlentities($lastResponse); } else { $truncatedLastResponse = substr(htmlentities($lastResponse), 0, 100) . nl2br("\n...\n") . substr(htmlentities($lastResponse), -100); } throw new RestCallException(sprintf('Error on Prestashop client to "%s": "%s".' . 'Something is probably wrong in the last SOAP response:' . nl2br("\n") . '"%s"', $this->clientParameters->getPrestashopUrl(), $e->getMessage(), $truncatedLastResponse), $e->getCode(), $e); } else { throw $e; } } }
/** * @param string $apiUser * @param string $apiKey * * @return bool * @throws \Exception */ public function login($apiUser = null, $apiKey = null) { if (null === $apiUser) { $apiUser = $this->apiUser; } if (null === $apiKey) { $apiKey = $this->apiKey; } if ($this->sessionId = $this->soapClient->login($apiUser, $apiKey)) { return true; } return false; }
public function wsAddPatient($patient) { try { $soapClient = new SoapClient(CommonProperties::$SIP_WSDL); $token = $soapClient->login(CommonProperties::$SIP_LOGIN, CommonProperties::$SIP_PASSWORD); try { return $soapClient->addPatientWs($token, $patient); } catch (Exception $ex) { return $ex->faultcode; // return $ex; } } catch (Exception $ex) { return $ex->faultcode; } }
/** * @see EPSInterface::login() */ public function login($username, $password) { try { $loginSdtClass = new stdClass(); $loginSdtClass->username = $username; $loginSdtClass->password = $password; $response = parent::login($loginSdtClass); if (isset($response->return)) { $resultLogin = new ResultLogin($response->return); } else { $resultLogin = null; } return $resultLogin; } catch (SoapFault $sf) { throw new ServerException($sf); } }
public function indexAction() { if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) { $isSecure = Mage::app()->getFrontController()->getRequest()->isSecure(); $validate_url = false; if ($isSecure) { if (Mage::getStoreConfig('web/secure/base_url') == Mage::getStoreConfig('web/secure/base_link_url')) { $validate_url = true; } } else { if (Mage::getStoreConfig('web/unsecure/base_url') == Mage::getStoreConfig('web/unsecure/base_link_url')) { $validate_url = true; } } if ($validate_url) { $details = Mage::app()->getRequest()->getParams(); $user = $details['userapi']; $api_key = $details['keyapi']; $deviceToken = $details['token']; $flag = $details['notification_flag']; $device_type = $details['device_type']; $url = $details['magento_url'] . 'api/soap?wsdl'; try { $soap = new SoapClient($url); $session_id = $soap->login($user, $api_key); } catch (SoapFault $fault) { $result['error'] = $fault->getMessage(); $jsonData = Mage::helper('core')->jsonEncode($result); return Mage::app()->getResponse()->setBody($jsonData); } if ($session_id) { $data[] = array('user' => $user, 'key' => $api_key, 'devicetoken' => $deviceToken, 'session_id' => $session_id, 'notification_flag' => $flag, 'device_type' => $device_type, 'is_logout' => 0); $result = $soap->call($session_id, 'mobileassistant.create', $data); $jsonData = Mage::helper('core')->jsonEncode($result); return Mage::app()->getResponse()->setBody($jsonData); } } else { $result['error'] = $this->__('There seems some difference between the Based URL & Magento Based URL(on the store). Please check & if issue persists, Contact our Support Team.'); } } else { $result['error'] = $this->__('Please activate the Mobile Assistant Extension on the Magento Store.'); } $jsonData = Mage::helper('core')->jsonEncode($result); return Mage::app()->getResponse()->setBody($jsonData); }
protected function _prepare() { $client = new SoapClient("http://hackathon.dev/api/soap/?wsdl"); //soap handle $apiuser = "******"; //webservice user login $apikey = "magentoimagine"; //webservice user pass try { $sess_id = $client->login($apiuser, $apikey); //we do login } catch (Exception $e) { //while an error has occured echo "==> Error: " . $e->getMessage(); //we print this } return $sess_id; }
/** * This action serves as a SOAP client to test the phonebook Web service. */ public function actionTest() { $wsdlUrl = Yii::app()->request->hostInfo . $this->createUrl('phonebook'); $client = new SoapClient($wsdlUrl); echo "<pre>"; echo "login...\n"; $client->login('demo', 'demo'); echo "fetching all contacts\n"; print_r($client->getContacts()); echo "\ninserting a new contact..."; $contact = new Contact(); $contact->name = 'Tester Name'; $contact->phone = '123-123-1234'; $client->saveContact($contact); echo "done\n\n"; echo "fetching all contacts\n"; print_r($client->getContacts()); echo "</pre>"; }
public function updateLicence($post_data) { $result = array(); $post_data['remote_addr'] = $_SERVER['REMOTE_ADDR']; $post_data['server_name'] = $_SERVER['SERVER_NAME']; $res = $this->getConfigData(); $url = base64_decode($res['url']); $webuser = base64_decode($res['webuser']); $webuser_pass = base64_decode($res['webuser_pass']); Mage::log($url . $webuser . $webuser_pass); $proxy = new SoapClient($url); $sessionId = $proxy->login($webuser, $webuser_pass); try { $result = $proxy->call($sessionId, 'user_licence.update', array('data' => $post_data)); } catch (Exception $e) { //echo $e->getMessage(); Mage::getSingleton('core/session')->addError($e->getMessage()); } return $result; }
protected function loadData() { $client = new SoapClient(null, array('location' => SOAP_LOCATION, 'uri' => SOAP_URI)); try { //* Login to the remote server if ($session_id = $client->login(SOAP_USER, SOAP_PASS)) { $mail_user = $client->mail_user_get($session_id, array('email' => $this->email)); if (count($mail_user) == 1) { $this->host = $client->server_get($session_id, $mail_user[0]['server_id'], 'server'); $this->user = $mail_user[0]; } else { throw new Exception("Unknown Account"); } } //* Logout $client->logout($session_id); } catch (SoapFault $e) { throw new Exception('SOAP Error: ' . $e->getMessage()); } }
/** * @param $credentials */ public function login($credentials) { $user = $credentials['user']; $password = $credentials['apipassword']; //Setting the client. $oSmartFeed = new \SoapClient("http://smartfeeds.belboon.com/SmartFeedServices.php?wsdl"); $oSessionHash = $oSmartFeed->login($user, $password); $this->_client = new \SoapClient('http://api.belboon.com/?wsdl', array('login' => $user, 'password' => $password, 'trace' => true)); $this->_client->getAccountInfo(); if (!$oSessionHash->HasError) { $sSessionHash = $oSessionHash->Records['sessionHash']; $aResult = $oSmartFeed->getPlatforms($sSessionHash); $platformList = array(); foreach ($aResult->Records as $record) { if ($record['status'] == "active") { $platformList[] = $record; } } $this->_platformList = $platformList; } }
/** */ protected function _changePassword($user, $oldpass, $newpass) { // Connect $soap_uri = $this->_params['soap_uri']; $client = new SoapClient(null, array('location' => $soap_uri . 'index.php', 'uri' => $soap_uri)); // Login try { if (!($session_id = $client->login($this->_params['soap_user'], $this->_params['soap_pass']))) { throw new Passwd_Exception(sprintf(_("Login to %s failed."), $soap_uri)); } } catch (SoapFault $e) { throw new Passwd_Exception($e); } // Get user information try { $users = $client->mail_user_get($session_id, array('login' => $user)); } catch (SoapFault $e) { throw new Passwd_Exception($e); } if (count($users) != 1) { throw new Passwd_Exception(sprintf(_("%d users with login %s found, one expected."), count($users), $user)); } $user = $users[0]; // Check the passwords match $this->_comparePasswords($user['password'], $oldpass); // Set new password $user['password'] = $newpass; // Save information try { $client->mail_user_update($session_id, $user['client_id'], $user['mailuser_id'], $user); } catch (SoapFault $e) { throw new Passwd_Exception($e); } // Logout try { $client->logout($session_id); } catch (SoapFault $e) { throw new Passwd_Exception($e); } }
/** * @name delete($pMail) * @param String * @return VR * @desc Supprime un mail de la mailing liste */ public function delete($pMail) { $lMailingListeValid = new MailingListeValid(); $lVr = $lMailingListeValid->validAjout($pMail); if ($lVr->getValid()) { // Initialisation du Logger $lLogger =& Log::singleton('file', CHEMIN_FICHIER_LOGS); $lLogger->setMask(Log::MAX(LOG_LEVEL)); try { $lSoap = new SoapClient(ADRESSE_WSDL); $lSession = $lSoap->login(SOAP_LOGIN, SOAP_PASS, "fr", false); $lSoap->mailingListSubscriberDel($lSession, MAIL_MAILING_LISTE_DOMAIN, MAIL_MAILING_LISTE, $pMail); $lSoap->logout($lSession); return true; } catch (SoapFault $pFault) { $lLogger->log("Echec de suppression de la mailing liste : " . $pFault . ".", PEAR_LOG_INFO); // Maj des logs return false; } } return $lVr; }
function checkmdwsconnect($AccessCode, $VerifyCode) { $checkstatus = 'Started'; $sitelist = 101; $client = new SoapClient("http://devmdws.vacloud.us/mdws2/EmrSvc.asmx?WSDL"); $connect = $client->connect(array('sitelist' => $sitelist)); $login = $client->login(array('username' => $AccessCode, 'pwd' => $VerifyCode, 'context' => '')); $chklogin = json_encode($login); //echo json_encode($login); // ----------------------------------------------------------------- // MWB 5/24/2012 - LEFT Justification of COMS_DEMO_JUN_8 problem is from here... // // The following commented lines both echo out "nothing" but since they are echoing out HTML tags // (which ends up rendering BEFORE the <DOCTYPE> tag) it throws off the normal CSS of the page. // We COULD echo out the data ONLY if there's something in the $strreturn and $strreturn2 variables if necessary // // Also, shouldn't the "$strreturn" variable really be a "$strreturn1" variable? $str1 = stristr($chklogin, 'Missing'); $strreturn1 = stristr($str1, '"', true); //echo "ST1".$strreturn1.""; //echo "<center><b>".$strreturn1."</b></center>";// <----- MWB 5/24/2012 This line (and the one below) are what cause COMS_DEMO_JUN_8 to left justify $str2 = stristr($chklogin, 'Not'); $strreturn2 = stristr($str2, '"', true); //echo "ST2".$strreturn2.""; //echo "<center><b>".$strreturn2."</b></center>";// <----- MWB 5/24/2012 This line (and the one above) are what cause COMS_DEMO_JUN_8 to left justify $str3 = stristr($chklogin, 'greeting'); $strreturn3 = stristr($str3, '"', true); //echo "ST3".$strreturn3.""; if ($strreturn1 === 'Not a Valid Access Code') { $checkstatus = "Not a Valid Access Code"; } elseif ($strreturn2 === 'Not a valid ACCESS CODE\\/VERIFY CODE pair.') { $checkstatus = "Not a Valid Access Code"; } else { $checkstatus = "Success"; } //echo $checkstatus; return $checkstatus; }
<?php require 'soap_config.php'; $client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1)); try { if ($session_id = $client->login($username, $password)) { echo 'Logged successfull. Session ID:' . $session_id . '<br />'; } //* Set the function parameters. $client_id = 1; $params = array('server_id' => 1, 'parent_domain_id' => 1, 'username' => 'tom', 'password' => 'secret', 'quota_size' => 10000, 'active' => 'y', 'uid' => '5000', 'gid' => '5000', 'dir' => '/home/www/clients/client0/web1', 'quota_files' => -1, 'ul_ratio' => -1, 'dl_ratio' => -1, 'ul_bandwidth' => -1, 'dl_bandwidth' => -1); $affected_rows = $client->sites_ftp_user_add($session_id, $client_id, $params); echo "FTP User ID: " . $affected_rows . "<br>"; if ($client->logout($session_id)) { echo 'Logged out.<br />'; } } catch (SoapFault $e) { echo $client->__getLastResponse(); die('SOAP Error: ' . $e->getMessage()); }
function save() { $confirm = $this->rcmail_inst->config->get('password_confirm_current'); if ($confirm && !isset($_POST['_curpasswd']) || !isset($_POST['_newpasswd'])) { $this->rcmail_inst->output->command('display_message', $this->gettext('nopassword'), 'error'); } else { $curpwd = rcube_utils::get_input_value('_curpasswd', RCUBE_INPUT_POST); $newpwd = rcube_utils::get_input_value('_newpasswd', RCUBE_INPUT_POST); $pwl = $this->rcmail_inst->config->get('password_min_length'); $checkUpper = $this->rcmail_inst->config->get('password_check_upper'); $checkLower = $this->rcmail_inst->config->get('password_check_lower'); $checkSymbol = $this->rcmail_inst->config->get('password_check_symbol'); $checkNumber = $this->rcmail_inst->config->get('password_check_number'); $error = false; if (!empty($pwl)) { $pwl = max(6, $pwl); } else { $pwl = 6; } if ($confirm && $this->rcmail_inst->decrypt($_SESSION['password']) != $curpwd) { $this->rcmail_inst->output->command('display_message', $this->gettext('passwordincorrect'), 'error'); } else { if (strlen($newpwd) < $pwl) { $error = true; $this->rcmail_inst->output->command('display_message', str_replace("%d", $pwl, $this->gettext('passwordminlength')), 'error'); } if (!$error && $checkNumber && !preg_match("#[0-9]+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordchecknumber'), 'error'); } if (!$error && $checkLower && !preg_match("#[a-z]+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordchecklower'), 'error'); } if (!$error && $checkUpper && !preg_match("#[A-Z]+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordcheckupper'), 'error'); } if (!$error && $checkSymbol && !preg_match("#\\W+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordchecksymbol'), 'error'); } if (!$error) { try { $soap = new SoapClient(null, array('location' => $this->rcmail_inst->config->get('soap_url') . 'index.php', 'uri' => $this->rcmail_inst->config->get('soap_url'))); $session_id = $soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass')); $mail_user = $soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username'])); $params = $mail_user[0]; $startdate = array('year' => substr($params['autoresponder_start_date'], 0, 4), 'month' => substr($params['autoresponder_start_date'], 5, 2), 'day' => substr($params['autoresponder_start_date'], 8, 2), 'hour' => substr($params['autoresponder_start_date'], 11, 2), 'minute' => substr($params['autoresponder_start_date'], 14, 2)); $enddate = array('year' => substr($params['autoresponder_end_date'], 0, 4), 'month' => substr($params['autoresponder_end_date'], 5, 2), 'day' => substr($params['autoresponder_end_date'], 8, 2), 'hour' => substr($params['autoresponder_end_date'], 11, 2), 'minute' => substr($params['autoresponder_end_date'], 14, 2)); $params['password'] = $newpwd; $params['autoresponder_end_date'] = $enddate; $params['autoresponder_start_date'] = $startdate; $uid = $soap->client_get_id($session_id, $mail_user[0]['sys_userid']); $update = $soap->mail_user_update($session_id, $uid, $mail_user[0]['mailuser_id'], $params); $soap->logout($session_id); $this->rcmail_inst->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); $_SESSION['password'] = $this->rcmail_inst->encrypt($newpwd); $this->rcmail_inst->user->data['password'] = $_SESSION['password']; } catch (SoapFault $e) { $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error'); } } } } $this->init_html(); }
/** * Login to QuoVadis Service. * * @return bool * @throws SetaPDF_Signer_Exception */ public function login() { $client = new SoapClient($this->_wsdl, array_merge($this->_clientOptions, array('trace' => true))); $req = array('loginRequest' => array('accountId' => $this->_accountId, 'secret' => $this->_password, 'clientId' => $this->_clientId, 'profile' => $this->_profile)); $result = $client->login($req); $this->_lastResult = $result; if ($result->return->result != 0) { throw new SetaPDF_Signer_Exception(sprintf('QuoVadis login failed with result code %s.', $result->return->result)); } $this->_ticket = $result->return->ticket; return true; }
<?php $client = new SoapClient('http://184.73.176.25/magento/index.php/api/?wsdl', array("trace" => 1)); // If soap isn't default use this link instead // http://youmagentohost/api/soap/?wsdl // If somestuff requires api authentification, // we should get session token $session = $client->login('needle', '123456'); // $id = $client->call($session, 'coupongenerator.clonerule', array('2', '__NDL_RULE', 'NEEDLE7')); $result = $client->call($session, 'coupongenerator.info', 2); print_r($result); // $result = $client->call($session, 'coupongenerator.delete', $id); // If you don't need the session anymore $client->endSession($session);
break; } $path = dirname(dirname(dirname(dirname(__FILE__)))) . '/documentation/manual/' . $lng . '/manual.xml.in'; echo 'Running wikification'; echo "\n\t date: " . date('Y-m-d H:i:s'); echo "\n\t styleshet: " . $stylesheet; echo "\n\t language: " . $lng; echo "\n\t space: " . $space; echo "\n\t path: " . $path; $book = new Confluence_Book($path); $book = $book->get(); $soap = new SoapClient('http://framework.zend.com/wiki/rpc/soap-axis/confluenceservice-v1?wsdl'); $token = $soap->login($confluenceUser, $confluencePass); $home = $soap->getPage($token, $space, 'Home'); $jira = new SoapClient('http://framework.zend.com/issues/rpc/soap/jirasoapservice-v2?wsdl'); $jiraToken = $jira->login($jiraUser, $jiraPass); $_components = $jira->getComponents($jiraToken, 'ZF'); $components = array(); foreach ($_components as $key => $component) { $components[$component->name] = $component->id; } $new = array(); $prev = array(); $compare = array(); echo "\n\nChecking for appendix page ... "; try { $appendix = $soap->getPage($token, $space, 'Appendix'); echo 'exists'; } catch (Exception $e) { echo 'does not exist - creating'; $page = new stdClass();
/** * Connect into the remote Ascio webservice * * Executes the 'login' command on Ascio's servers, to retrive the session variable * for execute the commands. * * @return string Session variable * @access private */ private function Connect() { $registrar = Registrars::getActiveRegistrarbyClass(__CLASS__); try { if (!empty($registrar['config'])) { if (empty($registrar['ascio_soapuri'])) { throw new Exception('Warning: Ascio Soap URI has been not set'); } if (empty($registrar['ascio_username'])) { throw new Exception('Warning: Ascio Username has been not set'); } if (empty($registrar['ascio_password'])) { throw new Exception('Warning: Ascio Password has been not set'); } if (!empty($registrar)) { $soap = new SoapClient($registrar['ascio_soapuri']); $this->session['id'] = $soap->login($registrar['ascio_username'], $registrar['ascio_password'], "en", false); return $soap; } } } catch (Exception $e) { throw new Exception($e->getMessage()); } }
<?php $client = new SoapClient(null, array('location' => 'http://localhost/services/server.php', 'uri' => 'http://localhost/services/')); echo $client->login();
* * Tuleap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Tuleap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ if ($argc < 2) { die("Usage: " . $argv[0] . " group_id tracker_id \n"); } $serverURL = isset($_SERVER['TULEAP_SERVER']) ? $_SERVER['TULEAP_SERVER'] : 'http://sonde.cro.enalean.com'; $login = isset($_SERVER['TULEAP_USER']) ? $_SERVER['TULEAP_USER'] : '******'; $password = isset($_SERVER['TULEAP_PASSWORD']) ? $_SERVER['TULEAP_PASSWORD'] : '******'; // Establish connexion to the server $soapLogin = new SoapClient($serverURL . '/soap/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); $requesterSessionHash = $soapLogin->login($login, $password)->session_hash; $group_id = $argv[1]; $tracker_id = $argv[2]; // Connecting to the soap's tracker client $soapTracker = new SoapClient($serverURL . '/plugins/tracker/soap/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); //Executing method getTrackerSemantic try { $response = $soapTracker->getTrackerStructure($requesterSessionHash, $group_id, $tracker_id); var_dump($response); } catch (Exception $e) { var_dump($soapTracker->__getLastResponse()); } $soapLogin->logout($requesterSessionHash);