當前位置: 首頁>>代碼示例>>PHP>>正文


PHP soapclient::getError方法代碼示例

本文整理匯總了PHP中soapclient::getError方法的典型用法代碼示例。如果您正苦於以下問題:PHP soapclient::getError方法的具體用法?PHP soapclient::getError怎麽用?PHP soapclient::getError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在soapclient的用法示例。


在下文中一共展示了soapclient::getError方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: soapclient

 function run_transaction($vars, $method = 'threeDSecureEnrolmentRequest')
 {
     $client = new soapclient($u = 'https://www.secpay.com/java-bin/services/SECCardService?wsdl', true);
     $err = $client->getError();
     if ($err) {
         return array('message' => sprintf(_PLUG_PAY_SECPAY_ERROR, $err));
     }
     $result = $client->call($method, $vars, "http://www.secpay.com");
     // Check for a fault
     if ($client->fault) {
         if ($err) {
             return array('message' => _PLUG_PAY_SECPAY_ERROR2 . join(' - ', array_values($result)));
         }
     } else {
         // Check for errors
         $err = $client->getError();
         if ($err) {
             return array('message' => sprintf(_PLUG_PAY_SECPAY_ERROR3, $err));
         } else {
             if ($result[0] == '?') {
                 $result = substr($result, 1);
             }
             $ret = $this->reparse($result);
             return $ret;
         }
     }
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:27,代碼來源:secpay.inc.php

示例2: create_soap_client

function create_soap_client()
{
    $client = new soapclient('http://siap.ufcspa.edu.br/siap_ws.php?wsdl', true);
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
        // At this point, you know the call that follows will fail
    }
    return $client;
}
開發者ID:GoPlaceIn,項目名稱:siacc,代碼行數:11,代碼來源:siacc_wsclient.php

示例3: Connect

 public function Connect()
 {
     // instantiate wsdl cache manager
     if ($this->mDbConfig['db_wsdl_cache_path'] != '' && $this->mDbConfig['db_wsdl_cache_enabled']) {
         $wsdl_cache = new wsdlcache($this->mDbConfig['db_wsdl_cache_path'], $this->mDbConfig['db_wsdl_cache_lifetime']);
     }
     // try to get from cache first...
     $wsdl_url = $this->mDbConfig['db_wsdl_url'];
     if ($this->mDbConfig['db_namespace']) {
         $wsdl_url_query = parse_url($wsdl_url, PHP_URL_QUERY);
         if (!$wsdl_url_query) {
             $wsdl_url .= '?nspace=' . $this->mDbConfig['db_namespace'];
         } else {
             $wsdl_url .= '&nspace=' . $this->mDbConfig['db_namespace'];
         }
     }
     if ($wsdl_cache) {
         $wsdl = $wsdl_cache->get($wsdl_url);
     }
     // cache hit? if not, get it from server and put to cache
     if (!$wsdl) {
         SysLog::Log('Cache MISSED: ' . $wsdl_url, 'SoapDatabaseEngine');
         $wsdl = new wsdl($wsdl_url, $this->mDbConfig['db_proxy_host'], $this->mDbConfig['db_proxy_port'], $this->mDbConfig['db_proxy_user'], $this->mDbConfig['db_proxy_pass'], $this->mDbConfig['db_connection_timeout'], $this->mDbConfig['db_response_timeout']);
         $this->mErrorMessage = $wsdl->getError();
         if ($this->mErrorMessage) {
             SysLog::Log('WSDL error: ' . $this->mErrorMessage, 'DatabaseEngine');
             $this->mErrorMessage = 'An error has occured when instantiating WSDL object (' . $this->mDbConfig['db_wsdl_url'] . '&nspace=' . $this->mDbConfig['db_namespace'] . '). The error was: "' . $this->mErrorMessage . '" Check your WSDL document or database configuration.';
             return FALSE;
         }
         if ($wsdl_cache) {
             $wsdl_cache->put($wsdl);
         }
     } else {
         SysLog::Log('Cache HIT: ' . $this->mDbConfig['db_wsdl_url'] . '&nspace=' . $this->mDbConfig['db_namespace'], 'SoapDatabaseEngine');
     }
     // use it as usual
     $temp = new soapclient($wsdl, TRUE, $this->mDbConfig['db_proxy_host'], $this->mDbConfig['db_proxy_port'], $this->mDbConfig['db_proxy_user'], $this->mDbConfig['db_proxy_pass'], $this->mDbConfig['db_connection_timeout'], $this->mDbConfig['db_response_timeout']);
     $this->mErrorMessage = $temp->getError();
     if (!$this->mErrorMessage) {
         $this->mrDbConnection = $temp->getProxy();
         if (isset($this->mDbConfig['db_credentials'])) {
             $this->mrDbConnection->setCredentials($this->mDbConfig['db_credentials']['user'], $this->mDbConfig['db_credentials']['pass'], $this->mDbConfig['db_credentials']['type'], $this->mDbConfig['db_credentials']['cert']);
         }
         return TRUE;
     } else {
         SysLog::Log('Error in SoapDatabaseEngine: ' . $temp->getError(), 'SoapDatabaseEngine');
         return FALSE;
     }
 }
開發者ID:rifkiferdian,項目名稱:gtfw_boostab,代碼行數:49,代碼來源:SoapDatabaseEngine.class.php

示例4: PinPaymentEnquiry

 function PinPaymentEnquiry($_authority)
 {
     $soapclient = new soapclient('https://pec.shaparak.ir/pecpaymentgateway/eshopservice.asmx?wsdl', 'wsdl');
     if (!$soapclient or $err = $soapclient->getError()) {
         echo $err . "<br />";
         return FALSE;
     } else {
         $status = $_status;
         $params = array('pin' => $this->pin, 'status' => $status, 'authority' => $_authority);
         // to see if we can change it
         $sendParams = array($params);
         $res = $soapclient->call('PinPaymentEnquiry', $sendParams);
         $status = $res['status'];
         return $status;
     }
 }
開發者ID:jnaroogheh,項目名稱:darvishi,代碼行數:16,代碼來源:ParsianGateway.php

示例5: invoke

 public function invoke($targetObject, $function, $arguments)
 {
     $proxyhost = '';
     $proxyport = '';
     $proxyusername = '';
     $proxypassword = '';
     $client = new soapclient($targetObject, true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
     $err = $client->getError();
     if ($err) {
         throw new Exception($err);
     }
     $args = array();
     foreach ($arguments as $argument) {
         if ($argument instanceof IAdaptingType) {
             $args[] = $argument->defaultAdapt();
         } else {
             $args[] = $argument;
         }
     }
     $serviceDesription;
     //			if(isset($_SESSION['wsdl'][$targetObject][$function]))
     //			{
     //				$serviceDesription = unserialize($_SESSION['wsdl'][$targetObject][$function]);
     //				var_dump($serviceDesription);
     //			}
     //			else
     //			{
     $webInsp = new WebServiceInspector();
     $webInsp->inspect($targetObject, $function);
     $serviceDesription = $webInsp->serviceDescriptor;
     $_SESSION['wsdl'][$targetObject][$function] = serialize($serviceDesription);
     //			}
     $methods = $serviceDesription->getMethods();
     $method = null;
     foreach ($methods as $method) {
         if ($method->getName() == $function) {
             break;
         }
     }
     $postdata = array(array());
     foreach ($method->getArguments() as $argument) {
         $this->getArrayArguments($postdata[0], $argument->getType(), $args);
     }
     $result = $client->call($function, $postdata);
     return new Value($result);
 }
開發者ID:sigmadesarrollo,項目名稱:logisoft,代碼行數:46,代碼來源:WebServiceHandler.php

示例6: soapclient

 function process_thanks(&$vars)
 {
     global $db;
     require_once 'lib/nusoap.php';
     if ($vars['result'] != 'success') {
         return "Payment failed.";
     }
     $client = new soapclient('http://wsdl.eu.clickandbuy.com/TMI/1.4/TransactionManagerbinding.wsdl', true);
     $err = $client->getError();
     if ($err) {
         return "Error: " . $err;
     }
     $payment_id = intval($vars['payment_id']);
     $pm = $db->get_payment($payment_id);
     $product =& get_product($pm['product_id']);
     if ($product->config['is_recurring']) {
         ////// set expire date to infinite
         ////// admin must cancel it manually!
         $p['expire_date'] = '2012-12-31';
         $db->update_payment($payment_id, $p);
     }
     if ($this->config['disable_second_confirmation']) {
         $err = $db->finish_waiting_payment($pm['payment_id'], 'clickandbuy', $pm['data']['trans_id'], '', $vars);
         if ($err) {
             return "Error: " . $err;
         }
     } else {
         $secondconfirmation = array('sellerID' => $this->config['seller_id'], 'tmPassword' => $this->config['tm_password'], 'slaveMerchantID' => '0', 'externalBDRID' => $pm['data']['ext_bdr_id']);
         /*Start Soap Request*/
         $result = $client->call('isExternalBDRIDCommitted', $secondconfirmation, 'https://clickandbuy.com/TransactionManager/', 'https://clickandbuy.com/TransactionManager/');
         if ($client->fault) {
             return "Soap Request Fault [" . $client->getError() . "]";
         } else {
             $err = $client->getError();
             if ($err) {
                 return "Error " . $err;
             } else {
                 $err = $db->finish_waiting_payment($pm['payment_id'], 'clickandbuy', $pm['data']['trans_id'], '', $vars);
                 if ($err) {
                     return "Error " . $err;
                 }
             }
         }
     }
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:45,代碼來源:clickandbuy.inc.php

示例7: inspect

 public function inspect($wsdlUrl, $methodName = "")
 {
     //		$wsdlUrl = "http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl";
     //		$wsdlUrl = "http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl";
     //		$wsdlUrl = "http://ws.cdyne.com/NotifyWS/PhoneNotify.asmx?wsdl";
     //		$methodName = "NotifyPhoneBasic";
     $wsdlXml = new DOMDocument();
     $wsdlXml->load($wsdlUrl);
     /*WebServiceDescriptor*/
     $this->serviceDescriptor = new WebServiceDescriptor();
     $this->definitions = $wsdlXml->getElementsByTagName("definitions")->item(0)->childNodes;
     $this->getTypes();
     /*DOMDocument*/
     $service = XmlUtil::getElementByNodeName($this->definitions, "service");
     /*string*/
     $serviceName = $service->documentElement->getAttribute("name");
     $this->serviceDescriptor->setName($serviceName);
     $proxyhost = '';
     $proxyport = '';
     $proxyusername = '';
     $proxypassword = '';
     $client = new soapclient($wsdlUrl, true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
     $err = $client->getError();
     if ($err) {
         throw new Exception($err);
     }
     $operations = $client->getOperations($methodName);
     //		var_dump($operations);
     //		if(LOGGING)
     //			Log::log(LoggingConstants::MYDEBUG, ob_get_contents());
     foreach ($operations as $operation) {
         /*WebServiceMethod*/
         $webServiceMethod = new WebServiceMethod();
         $this->parseMessageInput($operation['input']['message'], $webServiceMethod);
         $webServiceMethod->setReturn($this->parseMessageOutput($operation['output']['message']));
         $webServiceMethod->setName($operation["name"], $webServiceMethod);
         $this->serviceDescriptor->addMethod($webServiceMethod);
     }
 }
開發者ID:sigmadesarrollo,項目名稱:logisoft,代碼行數:39,代碼來源:WebServiceInspector.php

示例8: gatewayNotify

 function gatewayNotify($gatewaysLogPath)
 {
     // Get from bank
     $authority = $_GET['au'];
     $status = $_GET['rs'];
     $cmd_id = intval($_GET['cmd_id']);
     $cmd_total = intval($_GET['cmd_total']);
     // Set soap
     $url = $this->getdialogURL();
     if (extension_loaded('soap')) {
         $soapclient = new SoapClient($url);
     } else {
         require_once 'nusoap.php';
         $soapclient = new soapclient($url, 'wsdl');
     }
     // here we update our database
     $save_ok = 0;
     if ($authority) {
         $save_ok = 1;
     }
     // doing
     if ($status == 0 && $save_ok) {
         if (!$soapclient || ($err = $soapclient->getError())) {
             // this is unsucccessfull connection
             $commande = null;
             $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
             if (is_object($commande)) {
                 $this->handlers->h_oledrion_commands->setOrderFailed($commande);
                 $user_log = 'خطا در پرداخت - خطا در ارتباط با بانک';
             } else {
                 $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
                 $user_log = 'خطا در ارتباط با بانک - اطلاعات پرداخت شما نا معتبر است';
             }
         } else {
             //$status = 1;
             $params = array('pin' => $this->getParsianMid(), 'authority' => $authority, 'status' => $status);
             $sendParams = array($params);
             $res = $soapclient->call('PinPaymentEnquiry', $sendParams);
             $status = $res['status'];
             if ($status == 0) {
                 // this is a succcessfull payment
                 // we update our DataBase
                 $commande = null;
                 $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
                 if (is_object($commande)) {
                     if ($cmd_total == intval($commande->getVar('cmd_total'))) {
                         $this->handlers->h_oledrion_commands->validateOrder($commande);
                         $user_log = 'پرداخت شما با موفقیت انجام شد. محصول برای شما ارسال می شود';
                     } else {
                         $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
                         $user_log = 'اطلاعات پرداخت شما نا معتبر است';
                     }
                 }
                 $log .= "VERIFIED\t";
             } else {
                 // this is a UNsucccessfull payment
                 // we update our DataBase
                 $commande = null;
                 $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
                 if (is_object($commande)) {
                     $this->handlers->h_oledrion_commands->setOrderFailed($commande);
                     $user_log = 'خطا در پرداخت - وضعیت این پرداخت صحیح نیست';
                 } else {
                     $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
                     $user_log = 'وضعیت این پرداخت صحیح نیست - اطلاعات پرداخت شما نا معتبر است';
                 }
                 $log .= "{$status}\n";
             }
         }
     } else {
         // this is a UNsucccessfull payment
         $commande = null;
         $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
         if (is_object($commande)) {
             $this->handlers->h_oledrion_commands->setOrderFailed($commande);
             $user_log = 'خطا در پرداخت - این پرداخت نا معتبر است';
         } else {
             $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
             $user_log = 'این پرداخت نا معتبر است - اطلاعات پرداخت شما نا معتبر است';
         }
         $log .= "{$status}\n";
     }
     // Ecriture dans le fichier log
     $fp = fopen($gatewaysLogPath, 'a');
     if ($fp) {
         fwrite($fp, str_repeat('-', 120) . "\n");
         fwrite($fp, date('d/m/Y H:i:s') . "\n");
         if (isset($status)) {
             fwrite($fp, "Transaction : " . $status . "\n");
         }
         fwrite($fp, "Result : " . $log . "\n");
         fwrite($fp, "Peyment note : " . $user_log . "\n");
         fclose($fp);
     }
     return $user_log;
 }
開發者ID:osw17,項目名稱:oledrion,代碼行數:96,代碼來源:gateway.php

示例9: soapclient

<?php
	require_once("lib/nusoap.php");
	header("Content-type: text/html; charset=utf-8");
	$client = new soapclient('http://127.0.0.1/nusoap/nusoap_server.php');
	$parameters=array("字符串1",'字符串2');
	$str=$client->call('concatenate',$parameters);
	if (!$err=$client->getError()) {
		echo " 程序返回 :",$str;
	} else {
		echo " 錯誤 :",$err;
	}
?> 
開發者ID:pf5512,項目名稱:phpstudy,代碼行數:12,代碼來源:nusoap_client.php

示例10: array

require_once SITE_FILE_ROOT . 'includes/nusoap/nusoap.php';
$google_license_key = "dJ5XAtRQFHIlbfutrovVj3TizF1Q2TXP";
$query = get_variable('query', 'POST');
$search_type = get_variable('search_type', 'POST', 0, 'int');
$limit = 10;
if (!$query) {
    script_close();
}
$query_command = $query;
if ($search_type === 1) {
    $query_command .= ' site:viperals.berlios.de';
}
$params = array('key' => (string) $google_license_key, 'q' => (string) $query_command, 'start' => (int) 0, 'maxResults' => (int) $limit, 'filter' => (bool) true, 'restricts' => (string) '', 'safeSearch' => (bool) false, 'lr' => (string) '', 'ie' => 'UTF-8', 'oe' => 'UTF-8');
$client = new soapclient('http://api.google.com/search/beta2');
$result = $client->call('doGoogleSearch', $params, 'urn:GoogleSearch');
if ($client->fault || $client->getError()) {
    script_close();
}
$pagination = generate_pagination('google_search&amp;query=' . urlencode($query) . '&amp;search_type=' . $search_type, $result['estimatedTotalResultsCount'], $limit, 0);
$count = count($result['resultElements']);
$num = 1;
for ($i = 0; $i < $count; $i++) {
    $_CLASS['core_template']->assign_vars_array('google_result', array('num' => $num, 'url' => $result['resultElements'][$i]['URL'], 'title' => $result['resultElements'][$i]['title'], 'snippet' => $result['resultElements'][$i]['snippet']));
    $num++;
}
unset($result);
$params = array('key' => (string) $google_license_key, 'phrase' => (string) $query);
$spelling_suggestion = $client->call('doSpellingSuggestion', $params, 'urn:GoogleSearch');
if (is_array($spelling_suggestion)) {
    $spelling_suggestion = false;
}
開發者ID:BackupTheBerlios,項目名稱:viperals-svn,代碼行數:31,代碼來源:ajax.php

示例11: soapclient

 *	Creation date: 13-03-2009
 *	Last modification: 22-05-2009 by Maria Alejandra Trujillo Valencia
 *
*/
$type = $_GET["type"];
$list_id = $_GET["list_id"];
$archive_id = $_GET["archive_id"];
//** SE INCLUYE LA CLASE DE SOAP **//
require "nusoap-0.7.3/lib/nusoap.php";
//** SE CREA EL CLIENTE **//
$url_server = "http://ezwebdev.eurodyn.com/mailing-services/serverMailmanLists";
$cliente = new soapclient("" . $url_server . "?wsdl", "true");
$proxy = $cliente->getProxy();
//** LLAMA AL METODO QUE SE NECESITA **//
$uri = $_SERVER["REQUEST_URI"];
$list = explode("?", $uri);
$sizeList = sizeOf($list);
if ($sizeList > 1) {
    $resultado = $proxy->ListList((string) "lists/" . $list[1] . "/archives.json");
} else {
    $resultado = $proxy->ListList((string) "lists.json");
}
//** SE REVISAN ERRORES **//
if (!$cliente->getError()) {
    print_r($resultado);
} else {
    echo "<h1>Error: " . $cliente->getError() . "</h1>";
}
?>

開發者ID:benzen,項目名稱:Ulysse,代碼行數:29,代碼來源:clientMailmanLists.php

示例12: soapclient

 function process_thanks(&$vars)
 {
     global $db;
     require_once 'lib/nusoap.php';
     if ($this->config['testmode']) {
         $url = "https://sandbox.api.bidpay.com/ThirdPartyPayment/v1/ThirdPartyPaymentService.asmx";
     } else {
         $url = "https://api.bidpay.com/ThirdPartyPayment/v1/ThirdPartyPaymentService.asmx";
     }
     $client = new soapclient($url, true);
     $err = $client->getError();
     if ($err) {
         return "Error: " . $err;
     }
     $vars = array('TransactionID' => '');
     $headers = "";
     $result = $client->call('ThirdPartyPaymentStatus', array('ThirdPartyPaymentStatusRequest' => $vars), 'http://api.bidpay.com/ThirdPartyPayment/v1/Messages/ThirdPartyPaymentStatusRequest-1-0', 'http://api.bidpay.com/ThirdPartyPayment/v1/Messages/ThirdPartyPaymentStatusRequest-1-0', $headers);
     if ($client->fault) {
         return "Soap Request Fault [" . $client->getError() . "]";
     } else {
         $err = $client->getError();
         if ($err) {
             return "Error " . $err;
         } else {
             /*
             TransactionID This is the ID assigned to the new status transaction by BidPay.
             OriginalPaymentRequestTransactionID This is the Transaction ID that was passed in the request.
             OrderID This is the Order ID assigned to the order by BidPay. If there is no Order ID, the buyer never completed the transaction.
             OrderStatus This is the status of the order. Values include Pending, Approved, Denied, Cancelled by Request, Cancelled as Duplicate, and Cancelled.
             CreditCardChargeStatus This is the status of the buyer’s credit card charge. Values include Pending, Authorized, Declined, Billed, and Cancelled.
             AchPaymentStatus This is the status of the ACH payment going out to the seller. Values include In Process, Payment Declined - Waiting on Customer Correction, Payment Completed, Cancelled, and Stop Payment.
             CreditCardRefundStatus This is the status of the credit card refund (when applicable). Values include In Process, Refund Completed, and Cancelled.
             */
             $err = $db->finish_waiting_payment(intval($vars['payment_id']), 'bidpay', $vars['transaction_id'], '', $vars);
             if ($err) {
                 return _PLUG_PAY_BIDPAY_ERROR . $err;
             }
         }
     }
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:40,代碼來源:bidpay.inc.php

示例13: call

 /**
  * Performs actual call to Google API.
  * @param query string params array
  * @return array boolean
  * @access private
  */
 function call($query, $params)
 {
     $soapclient = new soapclient($this->wsdlURL, 'wsdl', $this->nameSpace);
     if ($this->error = $soapclient->getError()) {
         //comment out echo, if you want to handle errors yourself using getError().
         //echo "Error instantiating SOAP client: " . $this->error;
         return false;
     }
     $result = $soapclient->call($query, $params);
     if ($this->error = $soapclient->getError()) {
         //comment out echo, if you want to handle errors yourself using getError().
         //echo "Error executing query: " . $this->error;
         return false;
     }
     return $result;
 }
開發者ID:nahakiole,項目名稱:cloudrexx,代碼行數:22,代碼來源:GoogleSearch.php

示例14: refresh

    /** Task to refresh available dids cart items
    */
    function refresh() {
    	# read configuration
    	$this->config();
    	
    	# include the soap classes
    	include_once(PATH_INCLUDES."nusoap/lib/nusoap.php");
		# Include the voip class
		include_once(PATH_MODULES.'voip/voip.inc.php');
		$voip = new voip;
    	
    	$db =& DB();
		$client = new soapclient("http://didx.org/cgi-bin/WebGetListServer.cgi", false);

		$err = $client->getError();
		if ($err) {
			global $C_debug;
			$C_debug->error('DIDX.php', 'refresh', 'Could not acquire information from DIDx.org');
		} else {
			$entries = split("\r\n", $this->country_area);
			foreach ($entries as $entry) {
				$eparts = split(":", $entry);
				$areas = split(",", $eparts[1]);
				$bDelete = true;
				foreach ($areas as $area) {
					$params = array(
						'UserID' 		=> $this->user,
						'Password' 		=> $this->pass,
						'CountryCode' 	=> $eparts[0],
						'AreaCode' 		=> $area
					);
					$result = $client->call('getAvailableDIDS', $params, 'http://didx.org/GetList');

					unset($queue);
					while (is_array($result) && (list($k,$v)=each($result)) !== false) {
						if (is_array($v)) {
							if ($v[0] < 0) {
								# error occured, let's log it!
								$this->log_message('refresh', 'SOAP Response: '.$this->codes[$v[0]]);
							} else {
								if ($eparts[0] == '1') {
									;
								} else {
									$v[0] = "011".$v[0];
								}
								# got a phone number! let's insert it into the pool
								$cc = ""; $npa = ""; $nxx = ""; $e164 = "";
								if ($voip->e164($v[0], $e164, $cc, $npa, $nxx)) {
									unset($fields);
									$fields['country_code'] = $cc;
									$fields['voip_did_plugin_id'] = $this->id;
									if ($cc == '1') {
										$fields['station'] = substr($e164, 8);
										$fields['npa'] = $npa;
										$fields['nxx'] = $nxx;
									} else {
										$fields['station'] = substr($e164, 4 + strlen($cc));
									}
									$rs = $db->Execute( sqlSelect($db,"voip_pool","id","country_code=::".$cc.":: AND voip_did_plugin_id=::".$this->id.":: AND station=::".$fields['station']."::"));
									if ($rs->RecordCount() == 0) {
										$queue[] = sqlInsert($db,"voip_pool",$fields);
									}
								} else {
									$this->log_message('refresh', 'Could not parse the phone number returned: '.$v[0]);
								}
							}
						}
					}
					if (isset($queue) && is_array($queue) && count($queue)) {
						if ($bDelete) {
							# kill db entries
							$sql = "DELETE FROM ".AGILE_DB_PREFIX."voip_pool WHERE 
								voip_did_plugin_id=".$this->id." AND (account_id IS NULL or account_id=0)
								AND country_code=".$eparts[0]."
								AND (date_reserved IS NULL or date_reserved=0)";
							$db->Execute($sql);
							$bDelete = false;
						}
						foreach ($queue as $q) {
							$db->Execute($q);
						}
					}
				} # end foreach area
			} # end foreach entries
		}
    }
開發者ID:hbustun,項目名稱:agilebill,代碼行數:87,代碼來源:DIDX.php

示例15: serp

 function serp($terms, $startFrom = 0)
 {
     global $wgGoogleAPIKey;
     global $wgUser;
     // prepare an array of input parameters to be passed to the remote   procedure
     // doGoogleSearch()
     $params = array('Googlekey' => $wgGoogleAPIKey, 'queryStr' => $terms, 'startFrom' => $startFrom, 'maxResults' => 10, 'filter' => true, 'restrict' => '', 'adultContent' => true, 'language' => '', 'iencoding' => '', 'oencoding' => '');
     // create a instance of the SOAP client object
     $soapclient = new soapclient("http://api.google.com/search/beta2");
     // uncomment the next line to see debug messages
     // $soapclient->debug_flag = 1;
     $MyResult = null;
     $MyResult = $soapclient->call("doGoogleSearch", $params, "urn:GoogleSearch", "urn:GoogleSearch");
     $err = $soapclient->getError();
     if ($err) {
         //error_log("GoogleAPI: An error occurred! $err {$soapclient->response}\n");
         return null;
     }
     /* Uncomment next line, if you want to see the SOAP envelop, which is forwarded to Google server, It is important to understand the content of SOAP envelop*/
     // echo '<xmp>'.$soapclient->request.'</xmp>';
     /* Uncomment next line, if you want to see the SOAP envelop, which is received from Google server. It is important to understand the SOAP packet forwarded from Google Server */
     // echo '<xmp>'.$soapclient->response.'</xmp>';
     // Print the results of the search
     //if ($MyResult['faultstring'])
     // echo $MyResult['faultstring'];
     //echo "errors?" . $MyResult['faultstring'];
     //echo "query: " . $MyResult['searchQuery'];
     //echo "count: " . $MyResult['estimatedTotalResultsCount'];
     //is_array($MyResult['resultElements']))
     //foreach ($MyResult['resultElements'] as $r)
     //echo "<tr><td>[$i] <a href=" . $r['URL'] . ">" . $r['title'] . "</a>";
     //echo $r['snippet'] . "(" . $r['cachedSize'] . ")</td></tr>";
     $result = array();
     $result[] = $MyResult['resultElements'];
     //$result[]= gSearch::suggest($terms);
     //return $MyResult['resultElements'];
     return $result;
 }
開發者ID:biribogos,項目名稱:wikihow-src,代碼行數:38,代碼來源:SearchEngineAPI.php


注:本文中的soapclient::getError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。