protected function getClientObj() { if ($this->clientObj) { return $this->clientObj; } $ProviderInfo = $this->_getProviderInfo(); if (!$ProviderInfo) { return false; } $serialNumber = $ProviderInfo['username']; $password = $ProviderInfo['password']; $sessionKey = $ProviderInfo['username']; $connectTimeOut = 2; $readTimeOut = 10; $proxyhost = false; $proxyport = false; $proxyusername = false; $proxypassword = false; $client = new EmayClient($this->websvcURL, $serialNumber, $password, $sessionKey, $proxyhost, $proxyport, $proxyusername, $proxypassword, $connectTimeOut, $readTimeOut); $client->setOutgoingEncoding("UTF-8"); $this->clientObj = $client; return $this->clientObj; }
private function _getClient() { $Setting = D('Setting'); $settings = $Setting->getSettings(); $gwUrl = 'http://sdkhttp.eucp.b2m.cn/sdk/SDKService?wsdl'; $serialNumber = $settings['SMS_serialNumber']; $password = $_SESSION['SMS_password']; $sessionKey = $Setting->getSessionKey(); $connectTimeOut = 2; $readTimeOut = 10; $proxyhost = false; $proxyport = false; $proxyusername = false; $proxypassword = false; require_once 'emay.php'; $client = new EmayClient($gwUrl, $serialNumber, $password, $sessionKey, $proxyhost, $proxyport, $proxyusername, $proxypassword, $connectTimeOut, $readTimeOut); $client->setOutgoingEncoding("UTF-8"); return $client; }