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;
}
Exemple #2
0
 /**
  * 建立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 getData($token)
{
    include_once '../connections.php';
    $wsdl = "http://localhost:3434/genevieve/ws/services.php?wsdl";
    //create client object
    $client = new nusoap_client($wsdl, 'wsdl');
    $favorite = $client->call('getFavorite', array('token' => $token));
    $favoriteSong = $favorite[0]['item'][0];
    $favoriteArtist = $favorite[0]['item'][1];
    $estatistica = $client->call('calcEstatic', array('favoriteSong' => $favoriteSong, 'favoriteArtist' => $favoriteArtist, 'token' => $token));
    return $estatistica;
}
Exemple #4
0
 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);
 }
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;
}
    /**
     * 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;
    }
 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;
 }
 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;
 }
Exemple #9
0
 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);
 }
Exemple #10
0
 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();
     }
 }
Exemple #11
0
 /**
  * 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>';
 }
Exemple #12
0
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;
}
Exemple #13
0
 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);
 }
    /**
     * 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;
    }
Exemple #15
0
 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'];
 }
Exemple #16
0
 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 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 />";
}
 /**
  * @Route("/oportunidades/ficha-de-selectividad/{id}", name="ficha-de-selectividad" )
  * @Template()
  */
 public function showAction($id)
 {
     //Login
     $client = new \nusoap_client("http://crm.cam-la.com/service/v4/soap.php?wsdl", 'true');
     $login_parameters = array('user_auth' => array('user_name' => 'admin', 'password' => md5($this->container->getParameter('passwd')), 'version' => '1'), 'application_name' => 'SoapAlarmasCRM', 'name_value_list' => array());
     $login_result = $client->call('login', $login_parameters);
     if (isset($login_result['faultstring'])) {
         throw new \Exception($login_result['detail']);
     }
     if (empty($login_result['id'])) {
         throw new \Exception("NO HAY ID DE SESION.");
     }
     $sessionId = $login_result['id'];
     //Buscar el cliente:
     $get_entry_list_parameters = array('session' => $sessionId, 'module_name' => 'Opportunities', 'query' => "opportunities.id = '" . $id . "'", 'order_by' => "date_entered ASC", 'offset' => '0', 'link_name_to_fields_array' => array(), 'max_results' => '1', 'deleted' => '0', 'Favorites' => false);
     $result = $client->call('get_entry_list', $get_entry_list_parameters);
     if (isset($result['faultstring'])) {
         throw new \Exception($result['detail']);
     }
     //Parseo la info:
     $info = array();
     foreach ($result['entry_list'] as $items) {
         $info = array();
         foreach ($items['name_value_list'] as $name => $value) {
             $info[$value['name']] = utf8_encode($value['value']);
         }
     }
     //Buscar el cliente:
     $get_entry_list_parameters = array('session' => $sessionId, 'module_name' => 'Accounts', 'query' => "accounts.id = '" . $info['account_id'] . "'", 'order_by' => "date_entered ASC", 'offset' => '0', 'link_name_to_fields_array' => array(), 'max_results' => '1', 'deleted' => '0', 'Favorites' => false);
     $result = $client->call('get_entry_list', $get_entry_list_parameters);
     if (isset($result['faultstring'])) {
         throw new \Exception($result['detail']);
     }
     //Parseo la info:
     $accountInfo = array();
     foreach ($result['entry_list'] as $items) {
         $accountInfo = array();
         foreach ($items['name_value_list'] as $name => $value) {
             $accountInfo[$value['name']] = utf8_encode($value['value']);
         }
     }
     //Busco la cuenta:
     return array('entity' => $info, 'account' => $accountInfo);
 }
 /**
  * @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;
 }
 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);
     //	echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
     //echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
     //echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
     return $result;
 }
Exemple #21
0
 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;
 }
 /**
  * @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);
 }
 /**
  * @return array
  * @param string $identifier
  */
 public function findPermissionExternal($identifier)
 {
     include 'nusoap/lib/nusoap.php';
     $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.permission'));
     $response = $client->call('retornaPermissoesSGDOC', array($identifier));
     if ($client->getError()) {
         throw new Exception($client->getError());
     }
     return json_decode($response);
 }
Exemple #24
0
function LeerRegistro()
{
    // la variable $llave permite retornar alguna marca que esté en el formato de salida
    // identificada entre $$LLAVE= .....$$
    $llave_pft = "";
    global $llamada, $valortag, $maxmfn, $arrHttp, $OS, $Bases, $xWxis, $Wxis, $Mfn, $db_path, $wxisUrl, $empwebservicequerylocation, $empwebserviceusersdb, $db;
    $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
    $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
    $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
    $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
    $useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
    $client = new nusoap_client($empwebservicequerylocation, false, $proxyhost, $proxyport, $proxyusername, $proxypassword);
    $err = $client->getError();
    if ($err) {
        echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
        echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
        exit;
    }
    $params = array('queryParam' => array("query" => array('login' => $arrHttp["login"])), 'database' => $empwebserviceusersdb);
    $result = $client->call('searchUsers', $params, 'http://kalio.net/empweb/engine/query/v1', '');
    //print_r($result);
    //die;
    $myllave = "";
    //Esto se ha complejizado con el asunto de la incorporación de mas de una base de datos
    if (is_array($result['queryResult']['databaseResult']['result']['userCollection'])) {
        $vectoruno = $result['queryResult']['databaseResult']['result']['userCollection'];
        if (is_array($vectoruno['user'])) {
            //Hay una sola base y ahí está el usuario
            $myuser = $vectoruno['user'];
            $db = $empwebserviceusersdb;
        } else {
            if (is_array($vectoruno[0])) {
                // hay un vector de dbnames, hay que encontrar en cual de ellos está el user, si está en mas de uno
                // joderse, se toma el primero
                foreach ($vectoruno as $elementos) {
                    if (is_array($elementos['user'])) {
                        $myuser = $elementos['user'];
                        $db = $elementos['!dbname'];
                    }
                }
            }
        }
        // Con el myuser recuperado me fijo si es que el passwd coincide
        if ($myuser['password'] == $arrHttp["password"] && strlen($arrHttp["password"]) > 3) {
            $vectorAbrev = $myuser;
            //print_r($vectorAbrev);
            //die;
            $myllave = $vectorAbrev['id'] . "|";
            $myllave .= "1|";
            $myllave .= $vectorAbrev['name'] . "|";
            $valortag[40] = "\n";
        }
    }
    return $myllave;
}
Exemple #25
0
 /**
  * 上传图片
  */
 private function sendToSPLImage($data)
 {
     $filepath = "D:/GYIP.WLPT.Business/Sybase/EAServer/bin/sign";
     try {
         $filename = $filepath . '/' . $data['company'] . '/' . $data['orderno'] . "." . $data['businessNo'] . ".jpg";
         if (!file_exists($filename)) {
             return -100;
         }
         ob_start();
         readfile($filename);
         $img = ob_get_contents();
         ob_end_clean();
         $size = strlen($img);
         /*
         $size = filesize($filename);
         $img = fread(fopen($filename,'rb'),$size);
         */
         /*
         $info = getimagesize($filename);
         //var_dump($info);
         header("content-type:".$info['mime']);
         echo $img;
         return;
         */
         $img = base64_encode($img);
         $content = "<CONTENTLIST>\n\t\t\t\t\t<CONTENT>\n\t\t\t\t\t<HEADER></HEADER>\n\t\t\t\t\t<DETAILLIST>\n\t\t\t\t\t<DETAIL>\n\t\t\t\t\t<ECNO>" . $data['orderno'] . "</ECNO>\n\t\t\t\t\t<LEGNO>" . $data['businessNo'] . "</LEGNO>\n\t\t\t\t\t<FLAG>base</FLAG>\n\t\t\t\t\t<AFILEBYTES>" . $img . "</AFILEBYTES>\n\t\t\t\t\t</DETAIL>\n\t\t\t\t\t</DETAILLIST>\n\t\t\t\t\t</CONTENT> \n\t\t\t\t\t</CONTENTLIST>";
         $response = $this->createResult('Sign Exception', $content);
         $result = $this->service->call("setTmsShipmentBackImage", array("tmsShipmentBackImageXml" => $response), '', '');
         if (!$result) {
             $this->addLog("the webservice was no result on setTmsShipmentBackImage.");
             $this->addLog($this->service->error_str);
             return false;
         }
         $result = $this->checkResult($result);
         if ($result === 404) {
             $this->addLog("404 in setTmsShipmentBackImage");
             return 404;
         } else {
             if ($result === 0) {
                 $this->addLog("result fault on setTmsShipmentBackImage:" . $result);
                 return false;
             } else {
                 if (DEBUG) {
                     $this->debug("uploadimg", htmlspecialchars_decode($response));
                     $this->debug("uploadimgresult", print_r($result, true));
                 }
             }
         }
     } catch (Exception $e) {
         $this->addLog("call setTmsShipmentBackImage Exception:" . $e->getMessage());
         return false;
     }
     return true;
 }
Exemple #26
0
function login($username, $password)
{
    $ConfigManager = new ConfigManager();
    $elementNamespace = $ConfigManager->getGecredNamespace();
    $gecredUrl = $elementNamespace . '.php?wsdl';
    $client = new nusoap_client($gecredUrl, true);
    // false: no WSDL
    // Call the SOAP method
    $result = $client->call('login', array('username' => $username, 'password' => $password));
    return $result;
}
Exemple #27
0
 /**
  * Funcion que valida si una cedula es valida o no valida con la registraduria a través de un WS
  * Se obtiene un array con todos los datos recibidos de la registraduria.
  * @author dmdiazf
  * @since  15/02/2016
  */
 public function validaCedulaWSData($cedula)
 {
     $retorno = array();
     $arrayXML = array();
     $client = new nusoap_client($this->wsdl, 'wsdl', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
     $param = array("cedulas" => '<?xml version="1.0" encoding="utf-8"?><solicitudConsultaEstadoCedula><NUIP>' . $cedula . '</NUIP></solicitudConsultaEstadoCedula>', "contrasena" => 'password', "entidad" => '9418', "usuario" => 'DANE');
     $result = $client->call("consultarCedulas", $param, '', '', false, true);
     $arrayXML = json_decode(json_encode((array) simplexml_load_string($result["return"])), 1);
     $retorno = $arrayXML["datosCedulas"]["datos"];
     return $retorno;
 }
 public function getInterface()
 {
     $formStr = "<h1><font color = '#9CF'>Choose a path of the certificate to show</font></h1>";
     $formStr .= "<form method = 'POST'>";
     $formStr .= "<table  border = '3' bgcolor ='#9CF'><tr><td>";
     require_once 'nusoap.php';
     $url = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
     $pathClient = new nusoap_client("{$url}/CPathSoapServer.php");
     $rootCertPath = $pathClient->call('CPath.getPath', array('pathName' => "RootCertPath"));
     $formStr .= "Path: <select name = 'path'>\n" . "<option value = '" . $rootCertPath . "'>{$rootCertPath}</option>\n";
     $certsDir = $pathClient->call('CPath.getPath', array('pathName' => "OutCertsPath"));
     if ($handle = opendir($certsDir)) {
         // browse directory
         while (false !== ($file = readdir($handle))) {
             if ($file != '.' && $file != '..') {
                 $formStr .= "<option value = '" . $certsDir . '/' . $file . "'>{$file}</option>\n";
             }
         }
         closedir($handle);
     } else {
         die("Error when opening certs dir!");
     }
     $certsDir = $pathClient->call('CPath.getPath', array('pathName' => "UserCertsPath"));
     if ($handle = opendir($certsDir)) {
         // browse directory
         while (false !== ($file = readdir($handle))) {
             if ($file != '.' && $file != '..') {
                 $formStr .= "<option value = '" . $certsDir . '/' . $file . "'>{$file}</option>\n";
             }
         }
         closedir($handle);
     } else {
         die("Error when opening certs dir!");
     }
     $formStr .= "</select>\n</td></tr><BR>";
     $formStr .= "<input type = 'hidden' name = 'sub' value = 'CCertInfo'>" . "<input type = 'submit' value = 'Show Certificate Text'>";
     $formStr .= "</table>";
     $formStr .= "</form>";
     return $formStr;
 }
Exemple #29
-1
 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;
         }
     }
 }
Exemple #30
-1
 /**
  *
  * @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);
             }
         }
     }
 }