public function sendSoapRequest($message) { $client = new nusoap_client(HOTEL_ENDPOINT, false); $client->setCredentials(USERNAME, PASSWORD); $result = $client->send($message, HOTEL_ENDPOINT); return json_encode($result); }
function getCardInfo($merchantnumber, $cardno_prefix, $amount, $currency, $acquirer) { require_once 'lib/nusoap.php'; global $epayresponse; global $fee; global $cardtype; global $cardtext; $returnVal = false; // // Initialize the nusoap object with the ePay WSDL // $client = new nusoap_client('https://ssl.ditonlinebetalingssystem.dk/remote/payment.asmx?WSDL', 'wsdl', '', '', '', ''); $err = $client->getError(); if ($err) { echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; exit; } // // Create an arry with the parameters to the webservice // $param = array('merchantnumber' => $merchantnumber, 'cardno_prefix' => $cardno_prefix, 'amount' => $amount, 'currency' => $currency, 'acquirer' => $acquirer); $result = $client->call('getcardinfo', array('parameters' => $param), '', '', false, true); // Check for a fault if ($client->fault) { echo '<h2>An error occured during webservice</h2><pre>'; print_r($result); echo '</pre>'; } else { // Check for errors $err = $client->getError(); if ($err) { // // Display the error // echo '<h2>An error occured during webservice</h2><pre>' . $err . '</pre>'; } else { // // Display the result // /*echo '<h2>Returning values from capturePayment</h2><pre>'; print_r($result); echo '</pre>';*/ if ($result['getcardinfoResult'] == 'true') { $returnVal = true; $fee = $result['fee']; $cardtype = $result['cardtype']; $cardtext = $result['cardtypetext']; } else { // // Only use the epayresponse and pbsresponse on errors! // $epayresponse = $result['epayresponse']; } } } return $returnVal; }
/** * Executes a request * @param type $method * @param type $params k,v pairs where v's are raw(not url encoded) */ public function call($method, $params = array()) { $params = is_array($params) ? $params : array(); $methods = array('Transaction24HourReportByInvoiceReference' => array('ewayCustomerInvoiceRef' => '')); $req = new nusoap_client($this->gateway, TRUE); $headers = <<<head <eWAYHeader xmlns="https://www.eway.com.au/gateway/services/TransactionReportService.asmx/"> <eWAYCustomerID>{$this->eway_customer_id}</eWAYCustomerID> <UserName>{$this->eway_username}</UserName> <Password>{$this->eway_password}</Password> </eWAYHeader> head; $req->setHeaders($headers); if (!isset($methods[$method])) { throw new Exception("This method is not yet implemented"); } $params = array_merge($methods[$method], $params); $tmp = ""; foreach ($params as $k => $v) { $tmp .= sprintf('<%s>%s</%s>', $k, $v, $k); } $body = <<<body <{$method} xmlns="https://www.eway.com.au/gateway/services/TransactionReportService.asmx/"> {$tmp} </{$method}> body; $result = $req->call($method, $body); //echo '<h2>Request</h2><pre>' . htmlspecialchars($req->request, ENT_QUOTES) . '</pre>'; //echo '<h2>Response</h2><pre>' . htmlspecialchars($req->response, ENT_QUOTES) . '</pre>'; return $result; }
function busca_exemplares($codigo_acervo_temp) { global $protocolo, $server; $client = new nusoap_client("{$protocolo}://{$server}/web_service/servidor_ws.php?wsdl"); $result = $client->call('busca_exemplares', array('codigo_acervo_temp' => $codigo_acervo_temp)); return $result; }
/** * Executes a request * @param type $method * @param type $params k,v pairs where v's are raw(not url encoded) */ public function call($method, $params = array()) { $params = is_array($params) ? $params : array(); $methods = array('CreateRebillCustomer' => array('customerTitle' => '', 'customerFirstName' => '', 'customerLastName' => '', 'customerAddress' => '', 'customerSuburb' => '', 'customerState' => '', 'customerCompany' => '', 'customerPostCode' => '', 'customerCountry' => '', 'customerEmail' => '', 'customerFax' => '', 'customerPhone1' => '', 'customerPhone2' => '', 'customerRef' => '', 'customerJobDesc' => '', 'customerComments' => '', 'customerURL' => ''), 'CreateRebillEvent' => array('RebillCustomerID' => '', 'RebillInvRef' => '', 'RebillInvDes' => '', 'RebillCCName' => '', 'RebillCCNumber' => '', 'RebillCCExpMonth' => '', 'RebillCCExpYear' => '', 'RebillInitAmt' => '', 'RebillInitDate' => '', 'RebillRecurAmt' => '', 'RebillStartDate' => '', 'RebillInterval' => '', 'RebillIntervalType' => '', 'RebillEndDate' => ''), 'QueryTransactions' => array('RebillCustomerID' => '', 'RebillID' => ''), 'DeleteRebillEvent' => array('RebillCustomerID' => '', 'RebillID' => ''), 'DeleteRebillCustomer' => array('RebillCustomerID' => ''), 'Transaction24HourReportByInvoiceReference' => array('ewayCustomerInvoiceRef' => '')); $req = new nusoap_client($this->gateway, TRUE); $headers = <<<head \t\t<eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill"> \t\t\t<eWAYCustomerID>{$this->eway_customer_id}</eWAYCustomerID> \t\t\t\t<Username>{$this->eway_username}</Username> \t\t\t\t<Password>{$this->eway_password}</Password> \t\t</eWAYHeader> head; $req->setHeaders($headers); if (!isset($methods[$method])) { throw new Exception("This method is not yet implemented"); } $params = array_merge($methods[$method], $params); $tmp = ""; foreach ($params as $k => $v) { $tmp .= sprintf('<%s>%s</%s>', $k, $v, $k); } $body = <<<body \t\t<{$method} xmlns="http://www.eway.com.au/gateway/rebill/manageRebill"> \t\t{$tmp} \t\t</{$method}> body; $result = $req->call($method, $body); return $result; }
private function _soapcall($call, $params) { require_once dirname(__FILE__) . '/lib/nusoap.php'; $soapclient = new nusoap_client('https://ssl.ditonlinebetalingssystem.dk/remote/payment.asmx?WSDL', 'wsdl'); $result = $soapclient->call($call, array('parameters' => $params)); /* Debug */ //echo '<h2>Request</h2><pre>' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '</pre>'; //echo '<h2>Response</h2><pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>'; //echo '<h2>Debug</h2><pre>' . htmlspecialchars($soapclient->debug_str, ENT_QUOTES) . '</pre>'; //echo '<pre>'; print_r($result); echo '</pre>'; // Check for a fault if ($soapclient->fault) { echo '<div class="alert error"><h2>Fault</h2><pre>'; print_r($result); echo '</pre></div>'; } else { // Check for errors $err = $soapclient->getError(); if ($err) { // Display the error echo '<div class="alert error"><h2>Error</h2><pre>' . $err . '</pre></div>'; } else { return $result; } } return false; }
function remote_action($method, $parameters) { global $endpoint; // specify the SOAP endpoint global $wsdl; // WSDL file if required global $debug; // enable debug dump $client = new nusoap_client($wsdl, true); $result = $client->call($method, $parameters); /* // TODO error handling // Check for a fault - this works with the PHP SoapClient if ($client->fault) { echo '<p><b>Fault: '; print_r($result); echo '</b></p>'; } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo '<p><b>Error: ' . $err . '</b></p>'; } else { // Display the result print_r($result); } } */ return $result; }
function inicializarWebService() { $proxy = array(); $proxy['server'] = !is_null($this->proxy) ? $this->proxy->server : false; $proxy['port'] = !is_null($this->proxy) ? $this->proxy->port : false; $proxy['username'] = !is_null($this->proxy) ? $this->proxy->username : false; $proxy['password'] = !is_null($this->proxy) ? $this->proxy->password : false; $client = new nusoap_client($this->configuracao->wsdl, false, $proxy['server'], $proxy['port'], $proxy['username'], $proxy['password'], 0, 3000); $client->setDebugLevel(9); $client->setUseCURL(true); if (!is_null($this->certificado)) { if (strlen($this->certificado->crt . $this->certificado->key . $this->certificado->pem) > 0) { $client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false); $client->setCurlOption(CURLOPT_SSL_VERIFYHOST, 2); $client->authtype = 'certificate'; if (strlen($this->certificado->crt) > 0) { $client->certRequest['sslcertfile'] = $this->certificado->crt; # file containing the user's certificate } if (strlen($this->certificado->key) > 0) { $client->certRequest['sslkeyfile'] = $this->certificado->key; # file containing the private key } if (strlen($this->certificado->pem) > 0) { $client->certRequest['cainfofile'] = $this->certificado->pem; # file containing the root certificate } } } $this->client = $client; }
public function callbackGateway() { $merchantID = $this->merchantID; $au = preg_replace('/[^a-z0-9]/', '', $_GET['au']); $ref_id = $_GET['order_id']; if (strlen($au) > 4) { $payment = Cshop::app()->getDb()->prepare(QueryBuilder::getInstance()->select()->from('payment')->where('id = ?')); $payment->execute(array($au)); $payment = $payment->fetch(); $amount = round($payment['amount'] / 10); $client = new nusoap_client('https://www.sibapal.com/payment/wsdl?wsdl', 'wsdl'); $res = $client->call("verify", array($merchantID, $amount, $au)); if ($payment['status'] == Application::STATUS_PENDING) { if (!empty($res) and $res == 1) { return $payment; } else { $message = 'پرداخت توسط سیباپال انجام نشده است .'; } } else { $message = 'سفارش قبلا پرداخت شده است.'; } } else { $message = 'شماره یکتا اشتباه است.'; } throw new Exception($message); }
function login() { $client = new nusoap_client('http://portalsi.pp3.co.id/wsouth.asmx?wsdl', true); $result = $client->call('valLoginAkun', array('xIDAPLIKASI' => 79, 'xUsername' => $this->input->post('username'), 'xPassword' => $this->input->post('password'))); //print_r($result); if ($result['valLoginAkunResult']['responType'] == 'E-017' || $result['valLoginAkunResult']['responType'] == 'E-018' || $result['valLoginAkunResult']['responType'] == 'E-003') { redirect($result['valLoginAkunResult']['URL_CP'], 'refresh'); } elseif (substr($result['valLoginAkunResult']['responType'], 0, 1) == 'S') { $this->session->set_userdata('login', 'true'); $this->session->set_userdata('username', $this->input->post('username')); $this->session->set_userdata('password', $this->input->post('password')); if ($result['valLoginAkunResult']['HAKAKSES'] == 803) { //ADMIN $GroupAkses = 01; } elseif ($result['valLoginAkunResult']['HAKAKSES'] == 802) { //USER $GroupAkses = 02; } $this->session->set_userdata('level_user', $GroupAkses); $this->session->set_userdata('nama_group', $result['valLoginAkunResult']['HAKAKSES_DESC']); $this->session->set_userdata('nama_user', $result['valLoginAkunResult']['NAMA']); $this->session->set_userdata('cabang', $result['valLoginAkunResult']['NAMA_CABANG']); $this->session->set_userdata('id_cabang', $result['valLoginAkunResult']['KD_CABANG']); $this->session->set_userdata('IDUSER', $result['valLoginAkunResult']['IDUSER']); $this->session->set_userdata('HP', $result['valLoginAkunResult']['HP']); $this->session->set_userdata('EMAIL', $result['valLoginAkunResult']['EMAIL']); redirect('dash'); } else { $this->index(); } }
/** * Test connection with values of soap auth administration settings */ public static function testConnection($a_ext_uid, $a_soap_pw, $a_new_user) { global $ilSetting; $settings = $ilSetting->getAll(); $server_hostname = $settings["soap_auth_server"]; $server_port = (int) $settings["soap_auth_port"]; $server_uri = $settings["soap_auth_uri"]; $namespace = $settings["soap_auth_namespace"]; $use_dotnet = $settings["soap_auth_use_dotnet"]; if ($settings["soap_auth_use_https"]) { $uri = "https://"; } else { $uri = "http://"; } $uri .= $server_hostname; if ($server_port > 0) { $uri .= ":" . $server_port; } if ($server_uri != "") { $uri .= "/" . $server_uri; } $soap_client = new nusoap_client($uri); if ($err = $soap_client->getError()) { return "SOAP Authentication Initialisation Error: " . $err; } $soapAction = ""; $nspref = ""; if ($use_dotnet) { $soapAction = $namespace . "/isValidSession"; $nspref = "ns1:"; } $valid = $soap_client->call('isValidSession', array($nspref . 'ext_uid' => $a_ext_uid, $nspref . 'soap_pw' => $a_soap_pw, $nspref . 'new_user' => $a_new_user), $namespace, $soapAction); return "<br>== Request ==" . '<br><pre>' . htmlspecialchars(str_replace("\" ", "\"\n ", str_replace(">", ">\n", $soap_client->request)), ENT_QUOTES) . '</pre><br>' . "<br>== Response ==" . "<br>Valid: -" . $valid["valid"] . "-" . '<br><pre>' . htmlspecialchars(str_replace("\" ", "\"\n ", str_replace(">", ">\n", $soap_client->response)), ENT_QUOTES) . '</pre>'; }
public function callbackGateway() { $au = $_GET['au']; $ref_id = $_GET['order_id']; if (strlen($au) > 4) { $payment = Cshop::app()->getDb()->prepare(QueryBuilder::getInstance()->select()->from('payment')->where('reference = ?')); $payment->execute(array($au)); $payment = $payment->fetch(); $merchantID = $this->merchant; $amount = round($payment['amount'] / 10); $client = new nusoap_client('http://jahanpay.com/webservice?wsdl', 'wsdl'); $res = $client->call("verification", array($merchantID, $amount, $au)); if ($payment['status'] == Application::STATUS_PENDING) { if (!empty($res) and $res == 1) { return $payment; } else { $message = 'پرداخت توسط جهان پی انجام نشده است .'; } } else { $message = 'سفارش قبلا پرداخت شده است.'; } } else { $message = 'شماره یکتا اشتباه است.'; } throw new Exception($message); }
public function verify($Amount, $typ) { require_once $_SERVER['DOCUMENT_ROOT'] . '/assets/lib/nusoap.php'; $MerchantID = $this->MerchantID; $Authority = $_GET['Authority']; if ($_GET['Status'] == 'OK') { // URL also Can be https://ir.zarinpal.com/pg/services/WebGate/wsdl $client = new nusoap_client('https://de.zarinpal.com/pg/services/WebGate/wsdl', 'wsdl'); $client->soap_defencoding = 'UTF-8'; $result = $client->call('PaymentVerification', array(array('MerchantID' => $MerchantID, 'Authority' => $Authority, 'Amount' => $Amount))); if ($result['Status'] == 100) { $msg = 'پرداخت شما با موفقیت انجام شد .کد پرداخت : ' . $result['RefID'] . '<br>'; switch ($typ) { case 'kharid_file': $msg .= 'آدرس لینک دانلود فایل مورد نظر به ایمیل شما ارسال شده است'; break; case 'advert_register': $msg .= '<br>آگهی شما پس ار تایید در سایت نمایش داده خواهد شد.'; break; } return array('bank_id' => 1, 'status' => '100', 'Authority' => $Authority, 'RefID' => $result['RefID'], 'msg' => $msg); return 'Transation success. RefID:' . $result['RefID']; } else { $msg = 'متاسفانه درحین پرداخت خطایی رخ داده است.<br>'; return array('bank_id' => 1, 'status' => $result['Status'], 'Authority' => $Authority, 'RefID' => '', 'msg' => $msg); return 'Transation failed. Status:' . $result['Status']; } } else { $msg = 'متاسفانه درحین پرداخت خطایی رخ داده است.<br>'; return array('bank_id' => 1, 'status' => 'NOK', 'Authority' => $Authority, 'RefID' => '', 'msg' => $msg); return 'Transaction canceled by user'; } return '<hr>Payment :: ' . $_SESSION['pay']; }
function getStatus($refid) { ini_set("soap.wsdl_cache_enabled", "0"); //$mkey = '465A86C858B0293DD478D3D664E4B0CB18BC18C0332215CCF7D7C891CA25C3FAA4F5FC7CB187BFDA7233A720A747FB9FDEC866EB8D20D7C262287716F11C48A5'; $mkey = 'CF82609ADB4A2352966649823625C1217BE486E1B23D4686621EFED077B0B42924B2098F0B36656BAC8B6008576BF05A254B244675B501DA3DF863311BF1BB75'; $t_ref = $refid; //$t_ref = '12345678'; //$p_id = '3996'; $p_id = '3944'; $hasval = $p_id . $t_ref . $mkey; $myHASH = hash("sha512", $hasval); $wsdlfile = "https://webpay.interswitchng.com/paydirect/services/webpayservice.svc?wsdl"; $msg = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.interswitchng.com/" xmlns:web="http://schemas.datacontract.org/2004/07/WebPAY.Core.ServiceFramework.Contract"> <soapenv:Header/> <soapenv:Body> <ser:GetTransactionData> <ser:transactionQueryRequest> <web:Hash>' . $myHASH . '</web:Hash> <web:ProductId>' . $p_id . '</web:ProductId> <web:TransactionReference>' . $t_ref . '</web:TransactionReference> </ser:transactionQueryRequest> </ser:GetTransactionData> </soapenv:Body> </soapenv:Envelope>'; //$s = new nusoap_client($wsdlfile); $s = new nusoap_client($wsdlfile, true); //$result = $s->call('GetTransactionData', $msg ,'http://services.interswitchng.com/','http://services.interswitchng.com/WebPayService/GetTransactionData'); $do = $s->send($msg, 'http://services.interswitchng.com/WebPayService/GetTransactionData'); $result = $s->responseData; $err = $s->getError(); if ($err) { // Display the error echo '<h2>Network Timeout! </h2><pre></pre><b>Ooopsy! Kindly hit the button below and hit <b>accept/send/yes</b> on all prompt request.</b><br /><br /><input type="button" value="Please Click here" onClick="document.location.reload(true);">'; } else { } return $result; }
private function _call($function_name, $inputs) { $params = array('merchant_site_code' => $this->merchantSiteCode, 'checksum' => $this->_makeChecksum($inputs), 'params' => '<params>' . $this->_convertArrayToXML($inputs) . '</params>'); $client = new nusoap_client($this->urlWS, true); $result = $client->call($function_name, $params); return $result; }
public function GetCredit() { $client = new nusoap_client($this->wsdl_link, 'wsdl'); $client->decodeUTF8(false); $result = $client->call('accountInfo', array('username' => $this->username, 'password' => $this->password)); return (int) $result['balance']; }
function connectToVPSServer($vps_node) { global $pro_mysql_vps_server_table; $q = "SELECT * FROM {$pro_mysql_vps_server_table} WHERE hostname='{$vps_node}';"; $r = mysql_query($q) or die("Cannot query \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error()); $n = mysql_num_rows($r); if ($n != 1) { die("Cannot find hostname {$vps_node} of VPS server line " . __LINE__ . " file " . __FILE__); } $a = mysql_fetch_array($r); $port = 8089; $soap_client = new nusoap_client("https://{$vps_node}:{$port}/"); $err = $soap_client->getError(); if ($err) { echo "Error: " . $err; return false; } $soap_client->setCredentials($a["soap_login"], $a["soap_pass"]); $err = $soap_client->getError(); if ($err) { echo "Error: " . $err; return false; } return $soap_client; }
public function callbackGateway() { global $db, $get; $Status = $_POST['status']; $Refnumber = $_POST['refnumber']; $Resnumber = $_POST['resnumber']; if ($Status == 100) { $ParspalPin = trim($this->merchant); $pass = $this->pass; $payment = Cshop::app()->getDb()->prepare(QueryBuilder::getInstance()->select()->from('payment')->where('reference = ?')); $payment->execute(array($Resnumber)); $payment = $payment->fetch(); $amount = round($payment['amount'] / 10); $soapclient = new nusoap_client('http://merchant.parspal.com/WebService.asmx?wsdl', 'wsdl'); $params = array('MerchantID' => $ParspalPin, 'Password' => $pass, 'Price' => $amount, 'RefNum' => $Refnumber); $res = $soapclient->call('verifyPayment', $params); $Status = $res['verifyPaymentResult']['ResultStatus']; if (strtolower($Status) == 'success') { return $payment; } else { $message = 'پرداخت ناموفق است. خطا'; } } else { $message = 'پرداخت ناموفق است. خطا'; } throw new Exception($message); }
/** * 建立nusoap client * */ private function create() { //登录服务 if (!$this->authservice) { $this->authservice = new nusoap_client("http://125.88.6.191/DexExchange/UserService.asmx?WSDL", true); $this->authservice->soap_defencoding = 'utf-8'; $this->authservice->decode_utf8 = false; } //生成ticket $result = $this->authservice->call("Login", array('authId' => $this->auth, 'authPassword' => $this->authpass), '', ''); if (C("DEBUG_MODE")) { $this->addLog("czLogin result:" . $result); } if (!$result) { return false; } if (!$result["LoginResult"]) { return false; } $this->ticket = $result["LoginResult"]; //制单服务 if (!$this->awbservice) { $this->awbservice = new nusoap_client("http://58.248.41.191:8080/MetaData/Awb?wsdl", true); $this->awbservice->soap_defencoding = 'utf-8'; $this->awbservice->decode_utf8 = false; $header = "<DexHeader xmlns=\"http://tang.csair.com/dex/\"><dexlocation>Awb</dexlocation><dextoken>{$this->ticket}</dextoken></DexHeader>"; $this->awbservice->setHeaders($header); } }
function include_crm() { global $wpdb; $table_name = $wpdb->prefix . "crm_config"; require_once 'lib/nusoap.php'; $crm_option = $wpdb->get_row("SELECT * FROM " . $table_name . " WHERE id = 0", ARRAY_A); $config['sugar_server'] = $crm_option['url'] . "/soap.php?wsdl"; // the Sugar username and password to login via SOAP $config['login'] = array('user_name' => $crm_option['username'], 'password' => $crm_option['password']); $config['application_name'] = substr(strrchr($crm_option['url'], '/'), 1); ?> <?php //print_r($config); // open a connection to the server $sugarClient = new nusoap_client($config['sugar_server'], 'wsdl'); if (!$sugarClient) { echo 'Please check your settings here'; exit; } /* echo "<pre>"; print_r($sugarClient); die; */ $err = $sugarClient->getError(); if ($err) { var_dump($err); die("asdfas"); } $sugarClientProxy = $sugarClient->getProxy(); if (!$sugarClientProxy) { echo 'URL is not valid for SugarCRM config settings , please check it out '; echo '<a href=' . site_url('wp-admin/admin.php?page=crm_config') . '>Here</a>'; exit; } // login using the credentials above $result = $sugarClientProxy->login($config['login'], $config['application_name']); $session_id = $result['id']; /* if($session_id ){ echo 'UserName or PassWord was wrong. Please Check it out '; echo '<a href='.site_url('wp-admin/admin.php?page=crm_config').'>Here</a>'; exit(); } */ $result = $sugarClientProxy->seamless_login($session_id); ?> <div id="crm_panel"> <iframe src="<?php echo $crm_option['url']; ?> /index.php?module=Home&action=index&MSID=<?php echo $session_id; ?> " scrolling="auto" frameborder="0" width="100%" height="2000"></iframe> </div> <?php }
function getValue($rpcNumber, $inStr) { $client = new nusoap_client("http://localhost/Webservice/service.asmx?wsdl", true); $params = array("rpcNumber" => $rpcNumber, "inStr" => $inStr); $data = $client->call("CallTHI", $params); print_r($data); echo "<hr />"; }
/** * @brief Call uBio's SOAP service to find all names that match query. * * @param Text The name to search for. * @param has_authority */ function ubio_namebank_search($text, $has_authority = false) { global $config; global $db; // Maybe we have this already? $namebankID = find_ubio_name_in_cache($text, $has_authority); if (count($namebankID) > 0) { return $namebankID; } // Not found, so make SOAP call $client = new nusoap_client('http://names.ubio.org/soap/', 'wsdl', $config['proxy_name'], $config['proxy_port'], '', ''); $err = $client->getError(); if ($err) { return $names; } // This is vital to get through Glasgow's proxy server $client->setUseCurl(true); $param = array('searchName' => base64_encode($text), 'searchAuth' => '', 'searchYear' => '', 'order' => 'name', 'rank' => '', 'sci' => 1, 'linkedVern' => 1, 'vern' => 1, 'keyCode' => $config['uBio_key']); $proxy = $client->getProxy(); $result = $proxy->namebank_search($param['searchName'], $param['searchAuth'], $param['searchYear'], $param['order'], $param['rank'], $param['sci'], $param['linkedVern'], $param['vern'], $param['keyCode']); // Check for a fault if ($proxy->fault) { // print_r($result); } else { // Check for errors $err = $proxy->getError(); if ($err) { } else { // Display the result print_r($result); if (isset($result['scientificNames'])) { // get the relevant matches foreach ($result['scientificNames'] as $r) { if ($has_authority) { $n = strtolower(base64_decode($r['fullNameString'])); // Strip punctuation $n = str_replace(",", "", $n); $n = str_replace("(", "", $n); $n = str_replace(")", "", $n); $text = str_replace(",", "", $text); $text = str_replace("(", "", $text); $text = str_replace(")", "", $text); } else { $n = strtolower(base64_decode($r['nameString'])); } //echo $n; if ($n == strtolower($text)) { // Store this name array_push($namebankID, $r['namebankID']); } // Store name in cache store_ubio_name($r); } } } } return $namebankID; }
protected function create() { $nuSoap = new \nusoap_client($this->getUrl() . '?wsdl', 'wsdl', false, false, false, false, 0, 10); $nuSoap->soap_defencoding = $this->getEncoding(); if ($nuSoap->getError()) { throw new Exception('SoapClient'); } return $nuSoap; }
/** * @return boolean * @param string $user * @param string $pass */ public function validate($user, $pass) { include 'nusoap/lib/nusoap.php'; $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.authentication')); $response = $client->call('validate', array($user, $pass)); if ($client->getError()) { throw new Exception($client->getError()); } return json_decode($response)->valid; }
function test_soap() { require_once APPPATH . 'libraries/nusoap/nusoap.php'; //includes nusoap // Same as application/libraries/nusoap/nusoap.php $n_params = array('name' => 'My Name', 'email' => '*****@*****.**'); $client = new nusoap_client('http://server.com/soap/server.php'); $result = $client->call('soapMethod', $n_params); echo $result; }
/** * Create an eWay SOAP client to the eWay token API. * * @param string $gateway_url * URL of the gateway to connect to (could be the test or live gateway) * @param string $eway_customer_id * Your eWay customer ID * @param string $username * Your eWay business centre username * @param string $password * Your eWay business centre password * * @return nusoap_client * A SOAP client to the eWay token API */ public static function createClient($gateway_url, $eway_customer_id, $username, $password) { // Set up SOAP client $soap_client = new nusoap_client($gateway_url, FALSE); $soap_client->namespaces['man'] = 'https://www.eway.com.au/gateway/managedpayment'; // Set up SOAP headers $headers = "<man:eWAYHeader><man:eWAYCustomerID>" . $eway_customer_id . "</man:eWAYCustomerID><man:Username>" . $username . "</man:Username><man:Password>" . $password . "</man:Password></man:eWAYHeader>"; $soap_client->setHeaders($headers); return $soap_client; }
/** * @return array */ public function load() { include 'nusoap/lib/nusoap.php'; $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.unit')); $response = $client->call('ListaUnidades'); if ($client->getError()) { throw new Exception($client->getError()); } return json_decode($response); }
function PaymentEnquiry($au, $rs) { $soapclient = new nusoap_client('https://pec.shaparak.ir/pecpaymentgateway/eshopservice.asmx?wsdl', 'wsdl'); $err = $soapclient->getError(); if (!$err) { $soapProxy = $soapclient->getError(); } if (!$soapclient or $err) { $error = $err . "<br />"; echo $error; return false; } else { $params = array('pin' => $this->pin, 'authority' => $au, 'status' => $rs); // to see if we can change it $sendParams = array($params); $res = $soapclient->call('PinPaymentEnquiry', $sendParams); //var_dump($res); $status = $res['status']; if ($status === 0) { return true; } else { return false; } } }
/** * * @param string $func : functioni ke bayad ejra shavad * @param array $params : parametr haye tabe' * @return array : [error, errMessage] agar be khata khord va [javab ha] agar dorost ejra shod */ function call_soap($func, $params = null) { require_once '../lib/nusoap.php'; $client = new nusoap_client("http://" . $this->_remote_ip . "/api/" . $this->_version . "/asa_travel_nusoap_server.php"); $error = $client->getError(); if ($error) { return array("error", $error); } $params['time_stamp'] = date('Y-m-d H:i:s'); $params['_user'] = $this->_user; $params['_pass'] = $this->_pass; $result = $client->call($func, $params); if ($client->fault) { return array("error", "ErrorCall"); } else { $error = $client->getError(); if ($error) { return array("error", $error); } else { $param = json_decode(gzuncompress(base64_decode($result))); if ($param[type] == 'sucess') { return $param[message]; } else { return array("error", $error); } } } }
/** * Make a new nusoap_client instance. * * @return nusoap_client * @throws SoupClientErrorException */ private function makeClient() { $client = new \nusoap_client($this->wsdl, 'wsdl'); if (!$client->getError()) { return $client; } throw new SoupClientErrorException('Could not make a nusoap_client instance.'); }