Пример #1
0
 protected function getClient()
 {
     if (!$this->client) {
         $this->client = new \SoapClient(null, ['location' => 'https://soap.subreg.cz/cmd.php', 'uri' => 'https://soap.subreg.cz/soap']);
         $res = $this->client->__call('Login', ['data' => ['login' => $this->login, 'password' => $this->password]]);
         if ($res['status'] != 'ok') {
             throw new IOException('Subreg: ' . $res['error']['errormsg']);
         }
         $this->key = $res['data']['ssid'];
     }
     return $this->client;
 }
Пример #2
0
 public function __call($function_name, $arguments)
 {
     $result = parent::__call($function_name, $arguments);
     $log = new jLogSoapMessage($function_name, $this, 'soap');
     jLog::log($log, 'soap');
     return $result;
 }
 public function __call($method, $arguments)
 {
     try {
         return parent::__call($method, $arguments);
     } catch (\SoapFault $e) {
         throw new ConnectionException("Problem with connecting BIG Register", 0, $e);
     }
 }
Пример #4
0
 function __call($function_name, $arguments)
 {
     $result = parent::__call($function_name, $arguments);
     if ($result instanceof SoapFault) {
         $result->faultstring = sprintf(_("AWS error [{$this->location}]: %s"), $result->faultstring);
     }
     return $result;
 }
Пример #5
0
 function __call($function_name, $arguments)
 {
     $result = parent::__call($function_name, $arguments);
     if ($result instanceof SoapFault) {
         $result->faultstring = sprintf(_("Cloud provider error: %s"), $result->faultstring);
     }
     return $result;
 }
Пример #6
0
 /**
  * @param string $action
  * @param array $params
  * @return mixed
  * @throws \SoapFault
  */
 private function call($action, $params)
 {
     $osticketClient = new \SoapClient($this->getWsdlUrl());
     try {
         $result = $osticketClient->__call($action, $params);
         return $result;
     } catch (\SoapFault $e) {
         throw $e;
     }
 }
Пример #7
0
 public function __call($name, $args)
 {
     // buckaroo requires all numbers to have period notation, otherwise
     // an internal error will occur on the server.
     $locale = setlocale(LC_NUMERIC, '0');
     setlocale(LC_NUMERIC, array('en_US', 'en_US.UTF-8'));
     $ret = parent::__call($name, $args);
     setlocale(LC_NUMERIC, $locale);
     return $ret;
 }
Пример #8
0
 public function callWebService($xmlStr, $businessType)
 {
     //header("content-type:text/html;charset=utf-8");
     try {
         $checkReceived = new CheckReceived($xmlStr, $businessType, "1");
         $param = array("checkReceived" => $checkReceived);
         $client = new SoapClient($this->jkf['web_service_url'], array('encoding' => 'UTF-8'));
         $result = $client->__call("checkReceived", $param);
         $strXML = (string) $result->return;
         $retXML = simplexml_load_string($strXML);
         $this->insertResult($retXML, "0");
     } catch (SOAPFault $e) {
         print $e;
     }
 }
Пример #9
0
 public function __call($method, $arguments)
 {
     if (empty($arguments)) {
         $arguments[] = array('apiKey' => $this->apiKey);
     } else {
         $arguments[0] = array_merge(array('apiKey' => $this->apiKey), $arguments[0]);
     }
     $result = NULL;
     try {
         $result = parent::__call($method, $arguments);
     } catch (Exception $e) {
         drupal_set_message(t('Failed to access CBIS: @message', array('@message' => $e->getMessage())));
     }
     return $result;
 }
Пример #10
0
 public function __call($function_name, $arguments)
 {
     $timeExecutionBegin = $this->_microtimeFloat();
     $ex = false;
     try {
         $result = parent::__call($function_name, $arguments);
     } catch (Exception $e) {
         $ex = $e;
     }
     $timeExecutionEnd = $this->_microtimeFloat();
     $log = new jLogSoapMessage($function_name, $this, 'soap', $timeExecutionEnd - $timeExecutionBegin);
     jLog::log($log, 'soap');
     if ($ex) {
         throw $ex;
     }
     return $result;
 }
Пример #11
0
 /**
  * Overides the call method, to keep making
  * requests if it times out.
  * 
  * @todo require a better way than using exceptions.
  * 
  * @access public
  * @param string $function_name
  * @param mixed $arguments
  * @return SoapClient
  * @throws \SoapFault
  */
 public function __call($function_name, $arguments)
 {
     $result = false;
     $max_retries = 5;
     $retry_count = 0;
     // Keep making the same request until you have reached 5 attempts.
     while (!$result && $retry_count < $max_retries) {
         try {
             $result = parent::__call($function_name, $arguments);
         } catch (SoapFault $fault) {
             sleep(1);
             $retry_count++;
         }
     }
     // Throw the error after 5 attempts
     if ($retry_count == $max_retries) {
         throw new \SoapFault('Failed after 5 attempts');
     }
     return $result;
 }
Пример #12
0
 public function __call($function_name, $arguments)
 {
     $result = false;
     $max_retries = 5;
     $retry_count = 0;
     while (!$result && $retry_count < $max_retries) {
         try {
             $result = parent::__call($function_name, $arguments);
         } catch (SoapFault $fault) {
             if ($fault->faultstring != 'Could not connect to host') {
                 throw $fault;
             }
         }
         sleep(1);
         $retry_count++;
     }
     if ($retry_count == $max_retries) {
         throw new SoapFault('Could not connect to host after 5 attempts');
     }
     return $result;
 }
function checkStatus($file)
{
    global $urlPath;
    $xml = simplexml_load_file($file);
    $lastupdate = explode(" / ", $xml->lastUpdate);
    $lastDate = explode(".", $lastupdate[1]);
    $lastTime = explode(":", $lastupdate[0]);
    $lastDateTime = mktime($lastTime[0], $lastTime[1], $lastTime[2], $lastDate[1], $lastDate[0], $lastDate[2]);
    $currentDateTime = mktime();
    // if we more thant 30 minutes, we guess that the system si down
    if ($currentDateTime - $lastDateTime > 600) {
        // Send a alarms
        $soapClient = new SoapClient("http://{$_SERVER['SERVER_NAME']}/{$urlPath}index.php?soap=notification.wsdl&password={$soapPassword}&username={$soapUsername}");
        $error = 0;
        try {
            $param = array('param' => array(array('key' => 'type', 'value' => 'ALARM'), array('key' => 'code', 'value' => '900'), array('key' => 'object', 'value' => '0')));
            $info = $soapClient->__call("sendMail", $param);
        } catch (SoapFault $fault) {
            $error = 1;
            print "\n            alert('Sorry, blah returned the following ERROR: " . $fault->faultcode . "-" . $fault->faultstring . ". We will now take you back to our home page.');\n            window.location = 'main.php';\n            ";
        }
    }
}
 public function __call($method, $params)
 {
     Mage::log("_call");
     //Mage::log($method);
     //Mage::log($params);
     //die;
     foreach ($params as $k => $v) {
         Mage::log("-------------------------afasdfagfagfr------------------------");
         Mage::Log("k is : {$k}");
         $data = $this->generateValidXmlFromObj($v);
         Mage::Log($data);
         //	if(is_object($v))
         //		Mage::Log("v is object ".print_r($v,true));
         //		else
         //	Mage::Log("v is string ".$v);
         if ($v === null) {
             Mage::Log("SPOTTED A NULL YO!!!");
             $this->mustParseNulls = true;
             $params[$k] = self::_NULL_;
         }
     }
     //die;
     return parent::__call($method, $data);
 }
 /**
  * Get images files from remote host (with webservices)
  * @param   array current ppt file
  * @return  array images files
  */
 private function _get_remote_ppt2lp_files($file)
 {
     // host
     $ppt2lp_host = api_get_setting('ppt_to_lp.host');
     // secret key
     $secret_key = sha1(api_get_setting('ppt_to_lp.ftp_password'));
     // client
     $options = array('location' => $ppt2lp_host, 'uri' => $ppt2lp_host, 'trace' => 1, 'exception' => 1, 'cache_wsdl' => WSDL_CACHE_NONE);
     $client = new SoapClient(null, $options);
     $result = '';
     $file_data = base64_encode(file_get_contents($file['tmp_name']));
     $file_name = $file['name'];
     $service_ppt2lp_size = api_get_setting('ppt_to_lp.size');
     $params = array('secret_key' => $secret_key, 'file_data' => $file_data, 'file_name' => $file_name, 'service_ppt2lp_size' => $service_ppt2lp_size);
     $result = $client->__call('wsConvertPpt', array('pptData' => $params));
     return $result;
 }
Пример #16
0
 /**
  * {@inheritdoc}
  * @see SoapClient::__call()
  */
 public function __call($function_name, $arguments)
 {
     return parent::__call($function_name, $arguments);
 }
 /**
  * Method call wrapper which adding S3 signature and default arguments to all S3 operations
  *
  * @author Alexey Sukhotin
  **/
 public function __call($method, $arguments)
 {
     /* Getting list of S3 web service functions which requires signing */
     $funcs = $this->__getFunctions();
     $funcnames = array();
     foreach ($funcs as $func) {
         preg_match("/\\S+\\s+([^\\)]+)\\(/", $func, $m);
         if (isset($m[1])) {
             $funcnames[] = $m[1];
         }
     }
     /* adding signature to arguments */
     if (in_array("{$method}", $funcnames)) {
         if (is_array($arguments[0])) {
             $arguments[0] = array_merge($arguments[0], $this->sign("{$method}"));
         } else {
             $arguments[0] = $this->sign("{$method}");
         }
     }
     /*$fp = fopen('/tmp/s3debug.txt', 'a+');
     		fwrite($fp, 'method='."{$method}". ' timestamp='.date('Y-m-d H:i:s').' args='.var_export($arguments,true) . "\n");
     		fclose($fp);*/
     return parent::__call($method, $arguments);
 }
 /**	6. 商品调仓请求
  **	功能:根据FromWarehouse,ToWarehouse,ItemID,Qty 进行调仓
  **	参数:1) FromWarehouse    从什么仓库调货(1=虚拟仓,2=零售仓)
  **        2) ToWarehouse      要调到什么仓库去(1=虚拟仓,2=零售仓)
  **        3) ItemID           要调的商品货号
  **        4) Qty              调仓数量
  **	返回:状态代码:状态消息.
  */
 public function AdjustInventory($FromWarehouse = 1, $ToWarehouse = 2, $ItemID = '', $Qty = '10', $remark = '')
 {
     $user_load_info = $this->UserLoad();
     if ($user_load_info === true) {
         //登入成功
         $client = new SoapClient($this->wsdl, array('login' => $this->login, 'password' => $this->password1));
         $get_inventory_result = $client->__call('AdjustInventory', array('AdjustInventory' => array('token' => $this->token, 'FromWarehouse' => $FromWarehouse, 'ToWarehouse' => $ToWarehouse, 'ItemID' => $ItemID, 'Qty' => $Qty)));
         //	$get_inventory_result = $client->__call('AdjustInventory',array("AdjustInventory"=>array("token"=>$this->token,"FromWarehouse"=>$FromWarehouse,"ToWarehouse"=>$ToWarehouse,"ItemID"=>$ItemID,"Qty"=>$Qty,"Remark"=>$remark)));
         //				pr($get_inventory_result);die;
         $get_inventory_result = (array) $get_inventory_result;
         return $get_inventory_result;
     } else {
         //登入失败
         return $user_load_info;
     }
 }
Пример #19
0
 public function getSpeedyAccountFullResponse($nospeedy)
 {
     $url = "http://" . $this->ip_addr2 . "/TelkomSystem/Radius/Services/ProxyService/getSpeedyAccount?wsdl";
     $client = new SoapClient($url, array('trace' => 1));
     $client->__setLocation($url);
     $param2 = array("in0" => $nospeedy, "in1" => 'telkom.net', "in2" => $nospeedy);
     $result = $client->__call("getSpeedyAccountFull", array('parameters' => $param2));
     $tmp = $client->__getLastResponse();
     $a = xmlstr_to_array($tmp);
     $out = $a['soap:Body']['ns1:getSpeedyAccountFullResponse']['ns1:out'];
     if ($_REQUEST['debug'] == 'api') {
         var_dump($a, $result, $tmp, $client, $out, $out['status']);
     }
     return $out;
 }
Пример #20
0
 public static function getTipoCambio()
 {
     try {
         $soapClient = new \SoapClient("http://www.banguat.gob.gt/variables/ws/TipoCambio.asmx?wsdl", ["trace" => 1]);
         $info = $soapClient->__call("TipoCambioDia", []);
         return $info->TipoCambioDiaResult->CambioDolar->VarDolar->referencia;
     } catch (Exception $e) {
         return 0;
     }
 }
Пример #21
0
 $sql = "\n select\n  *\n from\n  (select\n    h1.*\n   from\n    order_history h1\n    left outer join order_history h2 on\n      h1.id_order = h2.id_order\n      and h1.date_add < h2.date_add\n   where\n    h2.date_add is null) as s\n  join order_state_lang as l on\n   s.id_order_state = l.id_order_state\n   and l.id_lang = 1\n   and l.name = 'Awaiting fund transfer'\n  join orders o on\n   o.id_order = s.id_order\n  join currency c on\n   o.id_currency = c.id_currency;\n";
 $rows = Db::getInstance()->ExecuteS($sql);
 foreach ($rows as $row) {
     $line = "";
     foreach ($row as $key => $value) {
         $line .= "{$key}={$value} ";
     }
     echo "Charging for order: {$line}\n";
     $mid_token = $mod->getMidToken($row['iso_code']);
     $token = $mid_token['token'];
     $merchant_id = $mid_token['merchant_id'];
     $capture_request = array("token" => $token, "merchantId" => $merchant_id, "transactionId" => $row['payment_reference'], "description" => 'Withdrawal', "transactionAmount" => intval(floatval($row['total_paid_real']) * 100), "transactionReconRef" => 'Withdrawal');
     $client = new SoapClient($wsdl_url, array('trace' => true, 'exceptions' => true));
     try {
         $error = null;
         $response = $client->__call('Capture', array("parameters" => $capture_request));
         if ($response->CaptureResult->ResponseCode != 'OK') {
             $error = $response->CaptureResult->ResponseCode + ": " + $response->CaptureResult->ResponseText;
         }
     } catch (Exception $e) {
         $error = $e->getMessage();
     }
     if ($error == null) {
         $state = 'Funds transferred';
     } else {
         $state = 'Error transferring funds';
         $sql = "\n      insert into\n       message (id_cart, id_customer, id_employee, id_order, message, private, date_add)\n       select '{$row['id_cart']}', '{$row['id_customer']}', '{$row['id_employee']}', '{$row['id_order']}', '{$error}', 0, now();\n    ";
         Db::getInstance()->ExecuteS($sql);
     }
     $sql = "\n    insert into\n     order_history (id_employee, id_order, id_order_state, date_add)\n     select 0, '{$row['id_order']}', id_order_state, now() from order_state_lang where id_lang=1 and name='{$state}';\n  ";
     Db::getInstance()->ExecuteS($sql);
Пример #22
0
switch ($service) {
    case "search":
        if (!isset($_REQUEST['expression'])) {
            die("missing parameter <i>expression</i>");
        }
        if (!isset($_REQUEST['from'])) {
            die("missing parameter <i>from</i>");
        }
        if (!isset($_REQUEST['count'])) {
            die("missing parameter <i>count</i>");
        }
        if (!isset($_REQUEST['lang'])) {
            die("missing parameter <i>lang</i>");
        }
        $param = array('expression' => $_REQUEST['expression'], 'from' => $_REQUEST['from'], 'count' => $_REQUEST['count'], 'lang' => $_REQUEST['lang']);
        $resultado = $client->__call('search', $param);
        break;
    case "new_titles":
        $param = array('count' => $_REQUEST["count"], 'rep' => $_REQUEST["rep"]);
        $resultado = $client->__call('new_titles', $param);
        break;
    case "new_issues":
        $param = array('count' => $_REQUEST["count"], 'rep' => $_REQUEST["rep"]);
        $resultado = $client->__call('new_issues', $param);
        break;
    case "get_titles":
        if (isset($_REQUEST['issn'])) {
            if (is_string($_REQUEST['issn'])) {
                $issn = explode(',', $_REQUEST['issn']);
            } else {
                if (is_array($_REQUEST['issn'])) {
Пример #23
0
 public function __call($functionName, $arguments)
 {
     if ($this->_asyncResult == null) {
         $this->_asynchronous = false;
         $this->_asyncAction = null;
         if (preg_match('/Async$/', $functionName) == 1) {
             $this->_asynchronous = true;
             $functionName = str_replace('Async', '', $functionName);
             $this->asyncFunctionName = $functionName;
         }
     }
     try {
         $result = @parent::__call($functionName, $arguments);
     } catch (SoapFault $e) {
         throw new Exception(exceptionMsg($e));
     }
     if ($this->_asynchronous == true) {
         return $this->_asyncAction;
     }
     return $result;
 }
Пример #24
0
 function GetResponse()
 {
     $client = new SoapClient($this->ServiceUrl);
     $response = $client->__call($this->ServiceName, $this->RequestParams);
     return $response;
 }
 /**
  * Execute a SoftLayer API method
  *
  * @return object
  */
 public function __call($functionName, $arguments = null)
 {
     // Determine if we shoud be making an asynchronous call. If so strip
     // "Async" from the end of the method name.
     if ($this->_asyncResult == null) {
         $this->_asynchronous = false;
         $this->_asyncAction = null;
         if (preg_match('/Async$/', $functionName) == 1) {
             $this->_asynchronous = true;
             $functionName = str_replace('Async', '', $functionName);
             $this->asyncFunctionName = $functionName;
         }
     }
     try {
         $result = parent::__call($functionName, $arguments, null, $this->_headers, null);
     } catch (SoapFault $e) {
         throw new Exception('There was an error querying the SoftLayer API: ' . $e->getMessage());
     }
     if ($this->_asynchronous == true) {
         return $this->_asyncAction;
     }
     // remove the resultLimit header if they set it
     $this->removeHeader('resultLimit');
     return $result;
 }
Пример #26
0
 /**
  * Execute a SoftLayer API method
  *
  * @return object
  */
 public function __call($functionName, $arguments = null)
 {
     // The getPortalLoginToken method in the SoftLayer_User_Customer service
     // doesn't require an authentication header.
     if ($this->_serviceName == 'SoftLayer_User_Customer' && $functionName == 'getPortalLoginToken') {
         $this->removeHeader('authenticate');
     }
     // Determine if we shoud be making an asynchronous call. If so strip
     // "Async" from the end of the method name.
     if ($this->_asyncResult == null) {
         $this->_asynchronous = false;
         $this->_asyncAction = null;
         if (preg_match('/Async$/', $functionName) == 1) {
             $this->_asynchronous = true;
             $functionName = str_replace('Async', '', $functionName);
             $this->asyncFunctionName = $functionName;
         }
     }
     try {
         $result = parent::__call($functionName, $arguments, null, $this->_headers, null);
     } catch (SoapFault $e) {
         throw new Exception($e->getMessage());
     }
     if ($this->_asynchronous == true) {
         return $this->_asyncAction;
     }
     // remove the resultLimit header if they set it
     $this->removeHeader('resultLimit');
     return $result;
 }
Пример #27
0
 public function hookPayment($params)
 {
     if (!$this->active) {
         return;
     }
     global $smarty, $cart, $currency;
     if ($currency->iso_code == "SEK") {
         return;
     }
     $wsdl_url = $this->getNetaxeptWsdlUrl();
     $currency_iso_code = $currency->iso_code;
     // FIXME: Currency from invoice
     $mid_token = $this->getMidToken($currency_iso_code);
     $token = $mid_token['token'];
     $merchant_id = $mid_token['merchant_id'];
     $netaxept_url = Configuration::get('NETAXEPT_TERMINAL_URL');
     // FIXME: https
     $redirect_url = 'http://' . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'modules/netaxept/validation.php';
     $service_type = 'B';
     //B = BBS hosted terminal
     $transaction_id = md5(uniqid(rand(), true));
     $amount = round($cart->getOrderTotalLC(), 2) * 100;
     $order_number = intval($params['cart']->id);
     switch ($currency_iso_code) {
         // FIXME: Use global $language variable
         case 'NOK':
             $language == 'no_NO';
             break;
         case 'SEK':
             $language == 'sv_SE';
             break;
         case 'DKK':
             $language == 'da_DK';
             break;
         default:
             $language == 'en_GB';
     }
     $customer = new Customer(intval($params['cart']->id_customer));
     $customer_email = $customer->email;
     $customer_phone_number = $customer->id;
     $c = 0;
     foreach ($params['cart']->getProducts() as $arr) {
         $order_description .= $c++ > 0 ? ', ' . $arr['name'] : $arr['name'];
     }
     $description = $order_description;
     $description = substr($description, 0, 4000);
     // length limit 4000 chars
     $order_description = substr($order_description, 0, 1500);
     // length limit 1500 chars
     $pan_hash = '';
     $recurring_expiry_date = '';
     $recurring_frequency = '';
     $recurring_type = '';
     $service_type = '';
     $session_id = '';
     include dirname(__FILE__) . '/setup_request.class.php';
     //die($currency_iso_code);
     $setup_request = new SetupRequest($amount, $currency_iso_code, $customer_email, $customer_phone_number, $description, $language, $order_description, $order_number, $pan_hash, $recurring_expiry_date, $recurring_frequency, $recurring_type, $redirect_url, $service_type, $session_id, $transaction_id);
     $params_transaction = array("token" => "{$token}", "merchantId" => "{$merchant_id}", "request" => $setup_request);
     $client = new SoapClient($wsdl_url, array('trace' => true, 'exceptions' => true));
     try {
         $result = $client->__call('Setup', array("parameters" => $params_transaction));
     } catch (Exception $fault) {
         print_r($fault);
         die(1);
     }
     $setup_result = $result->SetupResult;
     $smarty->assign(array('setup_result' => $setup_result, 'netaxept_url' => $netaxept_url));
     return $this->display(__FILE__, 'netaxept.tpl');
 }
Пример #28
0
 function SendTelmMsg($content, $telarr)
 {
     if ($content == "") {
         $this->error("不能发送空短信");
     }
     if (is_array($telarr)) {
         $tel = array();
         foreach ($telarr as $k => $v) {
             $tel[] = $v;
         }
         $telnum = implode(",", $tel);
     } else {
         $telnum = $telarr;
     }
     $settingmsginfo = C("SendPhoneMsg");
     $CorpID = $settingmsginfo['CorpID'];
     $Pwd = $settingmsginfo['Pwd'];
     //判断操作系统
     // 		$agent=$_SERVER["HTTP_USER_AGENT"];
     // 		if(eregi("win",$agent)){
     // 			import ( '@.ORG.Snoopy' );
     // 			$snoopy=new Snoopy();
     // 			$content= iconv("UTF-8","GB2312",$content);
     // 			$aryPara = array('CorpID' => $CorpID, 'Pwd'=> $Pwd, 'Mobile'=> $telnum, 'Content'=> $content,'Cell'=>'','SendTime'=>'');
     // 			$snoopy->submit("http://www.ht3g.com/htWS/linkWS.asmx/BatchSend",$aryPara);//$formvars为提交的数组
     // 			return $snoopy->results;
     // 		}else{
     import('@.ORG.TelMsg.nusoap', '', $ext = '.php');
     $client = new SoapClient('http://www.ht3g.com/htWS/linkWS.asmx?WSDL');
     $aryPara = array('CorpID' => $CorpID, 'Pwd' => $Pwd, 'Mobile' => $telnum, 'Content' => $content, 'Cell' => '', 'SendTime' => '');
     $re = $client->__call('BatchSend', array('parameters' => $aryPara));
     return $re->BatchSendResult;
     // 		}
 }
Пример #29
0
 /**
  * Parse Response of Soap Requests with parent::__doRequest()
  *
  * @param string $method
  * @param array $args
  *
  * @throws SoapFault $ex
  * @return string $result
  */
 public function getResponseResult($method, $args)
 {
     static::$action = static::GET_RESULT;
     try {
         $result = parent::__call($method, $args);
     } catch (SoapFault $ex) {
         throw $ex;
     }
     static::$action = '';
     return $result;
 }
Пример #30
0
<?php

/*
   同步应届毕业签约/就业/升学/出国学生信息
*/
include_once "config.php";
include_once '../../common.php';
include_once S_ROOT . './source/function_common.php';
include_once S_ROOT . './uc_client/client.php';
$client = new SoapClient(SOAP_URL);
$starttime = time();
//date('H:i:s');
$data = date('Y-m-d H:i:s');
$num = $client->__call('getDataCount', array('username' => SOAP_NAME, 'password' => SOAP_KEY, 'serviceid' => SOAP_SERV3));
//print_r($num);
$t = intval($num / 1000);
if ($num % 1000 != 0) {
    $t = $t + 1;
}
for ($j = 0; $j < $t; $j++) {
    $msg = $client->__call('getData', array('username' => SOAP_NAME, 'password' => SOAP_KEY, 'serviceid' => SOAP_SERV3, 'start' => 1000 * $j, 'count' => 1000));
    //print_r($msg);
    //初始化
    foreach ($msg as $item) {
        //print_r($item);
        if ($item[4] == '101590041') {
            //echo "update ".tname('baseprofile')." set unit = '$item[5]' where collegeid = '$item[0]'";
            $setarr = array('unit' => $item[5]);
            $wherearr = array('collegeid' => $item[0], 'startyear' => $item[1]);
            $rs = updatetable('baseprofile', $setarr, $wherearr);
            //print_r($rs);