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;
}
Ejemplo n.º 2
0
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;
}
 /**
  * @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);
 }
 /**
  * @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 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 getError()
 {
     if (!$this->requestHasBeenExecuted) {
         return false;
     } elseif (!empty($this->results['faultcode'])) {
         return array('Message' => $this->results['faultstring']['!'], 'Type' => $this->results['faultcode']);
     } elseif ($this->client->getError()) {
         return array('Message' => $this->client->getError(), 'Type' => 1);
     } else {
         return $this->results['GetAccountStatusResult']['Exception'];
     }
 }
 /**
  * Purges remote files
  *
  * @param array   $files
  * @param array   $results
  * @return boolean
  */
 function purge($files, &$results)
 {
     if (empty($this->_config['username'])) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, __('Empty username.', 'w3-total-cache'));
         return false;
     }
     if (empty($this->_config['password'])) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, __('Empty password.', 'w3-total-cache'));
         return false;
     }
     require_once W3TC_LIB_DIR . '/Nusoap/nusoap.php';
     $client = new \nusoap_client(W3TC_CDN_MIRROR_AKAMAI_WSDL, 'wsdl');
     $error = $client->getError();
     if ($error) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, sprintf(__('Constructor error (%s).', 'w3-total-cache'), $error));
         return false;
     }
     $zone = $this->_config['zone'];
     $expressions = array();
     foreach ($files as $file) {
         $remote_path = $file['remote_path'];
         $expressions[] = $this->_format_url($remote_path);
     }
     $action = $this->_config['action'];
     $email = $this->_config['email_notification'];
     $email = implode(',', $email);
     $options = array('action=' . $action, 'domain=' . $zone, 'type=arl');
     if ($email) {
         $options[] = 'email-notification=' . $email;
     }
     $params = array($this->_config['username'], $this->_config['password'], '', $options, $expressions);
     $result = $client->call('purgeRequest', $params, W3TC_CDN_MIRROR_AKAMAI_NAMESPACE);
     if ($client->fault) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, __('Invalid response.', 'w3-total-cache'));
         return false;
     }
     $result_code = $result['resultCode'];
     $result_message = $result['resultMsg'];
     $error = $client->getError();
     if ($error) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, sprintf(__('Unable to purge (%s).', 'w3-total-cache'), $error));
         return false;
     }
     if ($result_code >= 300) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, sprintf(__('Unable to purge (%s).', 'w3-total-cache'), $result_message));
         return false;
     }
     $results = $this->_get_results($files, W3TC_CDN_RESULT_OK, __('OK', 'w3-total-cache'));
     return true;
 }
function funcionEjWS5($nroTramiteASD, $idTramiteEE, $idNuevoEstado)
{
    //CONEXION A LA BASE DE DATOS
    //Preparación de Datos de Conexión
    $ConexionTipoDB = "postgres";
    $ConexionHost = "localhost";
    $ConexionPuerto = "5433";
    $ConexionNombreDB = "EEMINSAL";
    $ConexionUsuario = "postgres";
    $ConexionPass = "******";
    $ConexionStringCompleto = "host={$ConexionHost} port={$ConexionPuerto} dbname={$ConexionNombreDB} user={$ConexionUsuario} password={$ConexionPass}";
    //La conexión en si:
    $conn =& ADONewConnection($ConexionTipoDB);
    $conn->PConnect($ConexionStringCompleto);
    //Comando a Ejecutar:
    $cliente22 = new nusoap_client("EjWS5_WebService_Interior.wsdl", true);
    $error22 = $cliente22->getError();
    if ($error22) {
        return $error22;
    }
    // insert de consulta
    $result22 = $cliente22->call("funcionEjWS5_Interior", array("nroTramiteASD22" => 11, "idTramiteEE22" => 22, "idNuevoEstado22" => 33));
    // insert respues
    $each_string = explode('charset=ISO-8859-1', htmlspecialchars($cliente22->response, ENT_QUOTES));
    foreach ($each_string as $key2 => $value2) {
        $dobleexplosion = explode(": ", trim($value2));
        foreach ($dobleexplosion as $key3 => $value3) {
            $tripleexplosion = explode("\n", $value3);
            foreach ($tripleexplosion as $key4 => $value4) {
                if (strpos($value4, 'xml version') !== false) {
                    $rs = $conn->Execute("INSERT INTO sch_minsal.mensajes(id_msg, id_app_origen, id_app_destino, msg, boo_msg_enviado, fecha_envio, fecha_respuesta, id_evento, id_servicio) VALUES (10, 1, 2,'{$value4}', true, '10-10-2010', '10-10-2010', 1, 1);");
                }
            }
        }
    }
    if ($cliente22->fault) {
        return $result22;
    } else {
        $error22 = $cliente22->getError();
        if ($error22) {
            return $error22;
        } else {
            //echo "<h2>Resultado Llamada:</h2><pre>";
            // insert de consulta
            //$rs = $conn->Execute("INSERT INTO sch_minsal.mensajes(id_msg, id_app_origen, id_app_destino, msg, boo_msg_enviado, fecha_envio, fecha_respuesta, id_evento, id_servicio) VALUES (8, 1, 2,'$result22', true, '10-10-2010', '10-10-2010', 1, 1);");
            return $result22;
            //echo "</pre>";
        }
    }
}
 /**
  * @return User
  * @param string $identifier
  */
 public function loadUser($identifier)
 {
     include 'nusoap/lib/nusoap.php';
     $client = new nusoap_client(Config::factory()->getParam('cmb.cpa.webservice.user'));
     $response = $client->call('loadUser', array($identifier));
     if ($client->getError()) {
         throw new Exception($client->getError());
     }
     $userExternal = json_decode($response);
     $userLocal = new stdClass();
     foreach ($userExternal as $attribute => $value) {
         $userLocal->{$attribute} = $value;
     }
     return $userLocal;
 }
Ejemplo n.º 10
0
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;
}
Ejemplo n.º 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>';
 }
Ejemplo n.º 12
0
 public function api()
 {
     $this->load->library("nusoap");
     $client = new nusoap_client($this->wdsl, 'wsdl', FALSE, FALSE, FALSE, FALSE, 30, 60);
     $client->decode_utf8 = false;
     $err = $client->getError();
     if ($err) {
         return 0;
     }
     $result = $client->call('Fdt_tracking_list', array('b_ma_dvi' => '160', 'b_so_hieu' => '1212'));
     $items = $result['Fdt_tracking_listResult']['TrackingItem'];
     echo "<pre>";
     var_dump($items);
     //        print_r($items);
     //        $result = $client->call('submit', $param, '', '', false, true);
     //        if ($client->fault || $client->getError()) {
     //            echo json_encode($response);
     //            exit;
     //        } else if (isset($result['submitReturn'])) {
     //            $_data = json_decode($result['submitReturn']);
     //            $response["call_id"] = $_data->data->call_id;
     //            if ($response["call_id"] != -1) {
     //                $response["state"] = 1;
     //                $response['msg'] = "Tạo cuộc gọi thành công!";
     //            }
     //        }
 }
Ejemplo n.º 13
0
 /**
  * Purges remote files
  *
  * @param array $files
  * @param array $results
  * @return boolean
  */
 function purge($files, &$results)
 {
     if (empty($this->_config['username'])) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, 'Empty username.');
         return false;
     }
     if (empty($this->_config['password'])) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, 'Empty password.');
         return false;
     }
     if (empty($this->_config['zones'])) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, 'Empty zones list.');
         return false;
     }
     w3_require_once(W3TC_LIB_NUSOAP_DIR . '/nusoap.php');
     $client = new nusoap_client(W3TC_CDN_MIRROR_COTENDO_WSDL, 'wsdl');
     $error = $client->getError();
     if ($error) {
         $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, sprintf('Constructor error (%s).', $error));
         return false;
     }
     $client->authtype = 'basic';
     $client->username = $this->_config['username'];
     $client->password = $this->_config['password'];
     $client->forceEndpoint = W3TC_CDN_MIRROR_COTENDO_ENDPOINT;
     foreach ((array) $this->_config['zones'] as $zone) {
         $expressions = array();
         foreach ($files as $file) {
             $remote_path = $file['remote_path'];
             $expressions[] = '/' . $remote_path;
         }
         $expression = implode("\n", $expressions);
         $params = array('cname' => $zone, 'flushExpression' => $expression, 'flushType' => 'hard');
         $client->call('doFlush', $params, W3TC_CDN_MIRROR_COTENDO_NAMESPACE);
         if ($client->fault) {
             $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, 'Invalid response.');
             return false;
         }
         $error = $client->getError();
         if ($error) {
             $results = $this->_get_results($files, W3TC_CDN_RESULT_HALT, sprintf('Unable to purge (%s).', $error));
             return false;
         }
     }
     $results = $this->_get_results($files, W3TC_CDN_RESULT_OK, 'OK');
     return true;
 }
Ejemplo n.º 14
0
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 
}
Ejemplo n.º 15
0
function sendSMS($para, $mensaje, $fecha, $hora, $titulo = '')
{
    $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
    $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
    $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
    $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
    $client = new nusoap_client('http://sms.krealo.com/smsdev/ServiceSMS.asmx?WSDL', 'wsdl', $proxyhost, $proxyport, $proxyusername, $proxypassword);
    $err = $client->getError();
    if ($err) {
        echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    }
    // Doc/lit parameters get wrapped
    $Username = "******";
    $KeyName = "OQTZHHYLDQ2C6I57BV50QNZOHMVO730MLMEQR30SLSTIY";
    //Clave Única SDK Mercacel
    $To = $para;
    //Numero de celular de 10 digitos
    $Title = $titulo;
    //Titlo para el mensaje. (No se envia)
    $Message = $mensaje;
    //Mensaje para enviar
    $Date = $fecha;
    //Fecha para envio
    $Time = $hora;
    //Hora para envio
    $param = array("Username" => $Username, "KeyName" => $KeyName, "To" => $To, "Title" => $Title, "Message" => $Message, "Date" => $Date, "Time" => $Time);
    $result = $client->call('SendSMS', array('parameters' => $param), '', '', false, true);
    // Check for a fault
    if ($client->fault) {
        echo '<h2>Fault</h2><pre>';
        print_r($result);
        echo '</pre>';
    } else {
        // Check for errors
        $err = $client->getError();
        if ($err) {
            // Display the error
            echo '<h2>Error</h2><pre>' . $err . '</pre>';
        } else {
            /*// Display the result
            		echo '<h2>Result</h2><pre>';
            		print_r($result);
            		echo '</pre>';*/
        }
    }
}
Ejemplo n.º 16
0
/**
 * @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;
}
Ejemplo n.º 17
0
 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;
 }
Ejemplo n.º 18
0
 function gestionarCreacionEncuesta($nombreEncuesta, $descripcionPregunta, $respuestas)
 {
     $cliente = new nusoap_client("http://crearencuesta.azurewebsites.net/consultarEncuestas.php?wsdl", true);
     $error = $cliente->getError();
     if ($error) {
         return false;
     }
     $respuesta = $cliente->call("crearEncuesta", array("nombreEncuesta" => $nombreEncuesta, "descripcionPregunta" => $descripcionPregunta, "respuesta1" => $respuestas['respuesta1'], "respuesta2" => $respuestas['respuesta2'], "respuesta3" => $respuestas['respuesta3'], "respuesta4" => $respuestas['respuesta4']));
     if ($cliente->fault) {
         return false;
     } else {
         $error = $cliente->getError();
         if ($error) {
             return false;
         } else {
             return $respuesta;
         }
     }
 }
Ejemplo n.º 19
0
 public function __construct($username, $password, $wsdl = 'http://api.anpdm.com/ExternalAPIService.asmx?wsdl')
 {
     // Init soapclient
     $this->soap_client = $soap_client = new nusoap_client($wsdl, 'wsdl');
     if ($soap_error = $soap_client->getError()) {
         $this->ThrowError($soap_error, -1, true);
     }
     // Set authentication
     $this->SetAuthenticationDetails($username, $password);
 }
Ejemplo n.º 20
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;
}
Ejemplo n.º 21
0
 /**
  * 
  * @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 __DIR__ . '/../lib/nusoap.php';
     $client = new nusoap_client("http://94.183.153.237/api/index.php");
     $error = $client->getError();
     if ($error) {
         return array("error", $error);
     }
     $result = $client->call($func, $params);
     if ($client->fault) {
         echo "Error1";
     } else {
         $error = $client->getError();
         if ($error) {
             echo 'ERRR ::' . $error;
         } else {
             return json_decode(gzuncompress(base64_decode($result)));
         }
     }
 }
Ejemplo n.º 22
0
 public static function decCredit($user, $pass, $price, $refrence_id, $agency_id = '')
 {
     //$result = $client->call('DecIncCredit', array('param'=>json_encode($params)));
     //        $params = array(
     //            'username' => $user,
     //            'password' => $pass,
     //            'agency_id' => (int) $agency_id
     //        );
     $out = array('err' => NULL, 'out' => NULL);
     if ($agency_id == '') {
         $conf = new conf();
         $agency_id = $conf->gohar_agency_id;
     }
     $params = array('username' => $user, 'password' => $pass, 'agency_id' => $agency_id, 'price' => $price, 'reference' => $refrence_id, 'DecInc' => 'Dec');
     $client = new nusoap_client('http://164.138.22.33/AAA/server.php?wsdl', true);
     $err = $client->getError();
     if ($err) {
         $out['err'] = $err;
     } else {
         $result = $client->call('DecIncCredit', array('param' => json_encode($params)));
         if ($client->fault) {
             $out['err'] = $result;
         } else {
             $err = $client->getError();
             if ($err) {
                 $out['err'] = $err;
             } else {
                 $gout = json_decode($result, TRUE);
                 if ($gout['error']['error_code'] != 0) {
                     $out['err'] = $gout['error'];
                 } else {
                     $out['out'] = $gout;
                 }
             }
         }
     }
     return $out;
 }
Ejemplo n.º 23
0
 function milagros()
 {
     $webserviceUrl = "http://172.26.98.91:8080/WS_ClientProveedor/hello?wsdl";
     $client = new nusoap_client($webserviceUrl, true);
     $err = $client->getError();
     if ($err) {
         echo $err;
     }
     $response = $client->call("getHelloWorld");
     print_r($response["return"]);
     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>';
 }
Ejemplo n.º 24
0
 public function send()
 {
     require_once DIR_SYSTEM . 'library/nusoap/nusoap.php';
     $client = new nusoap_client('http://pennytel.com/pennytelapi/services/PennyTelAPI?wsdl', 'wsdl');
     $err = $client->getError();
     if ($err) {
         return $err;
     }
     $param = array('id' => $this->username, 'password' => $this->password, 'type' => 1, 'to' => $this->to, 'message' => $this->message, 'date' => '2012-01-01T00:00:00');
     $result = $client->call('sendSMS', array($param));
     if ($client->fault) {
         return 'Fault: ' . print_r($result, true) . '. Response: ' . $client->response . '. Debug: ' . $client->debug_str;
     } else {
         // Check for errors
         $err = $client->getError();
         if ($err) {
             // Display the error
             return 'Error: ' . $err;
         } else {
             return $result;
         }
     }
 }
Ejemplo n.º 25
0
function conectarBancoTere()
{
    /*==== NOSOTROS  ====*/
    $cliente = new nusoap_client("componente.wsdl", true);
    $error = $cliente->getError();
    if ($error) {
        echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
    }
    $result = $cliente->call("pago", array('nro_tarjeta' => $_POST["nro_tarjeta"], 'cod_seg' => $_POST["cod_seg"], 'fecha_exp' => $_POST["fecha_exp"], 'monto' => $_POST["monto"], 'ci' => $_POST["ci"], 'nro_afiliado' => $_POST["nro_afiliado"]));
    // Si hay errores se imprimen.
    if ($cliente->fault) {
        echo "<h2>Fault error en la transaccion </h2><pre>";
        print_r($result);
        echo "</pre>";
    } else {
        $error = $cliente->getError();
        if ($error) {
            echo "<h2>Error en la transaccion</h2><pre>" . $error . "</pre>";
            $result = 0;
        } else {
            echo "<h1> Respuesta de la transaccion : </h1>";
            switch ($result) {
                case "00":
                    echo "<h3> transaccion exitosa! </h3>";
                    break;
                case "10":
                    echo "<h3> Datos invalidos </h3>";
                    break;
                case "01":
                    echo "<h3> Saldo insuficiente </h3>";
                    break;
                default:
                    echo "<h3> ups ha ocurrido un problema en la transaccion </h3>";
            }
        }
    }
}
Ejemplo n.º 26
0
 public function login()
 {
     if ($this->input->post()) {
         //$this->form_validation->set_rules('inputWs', 'URL Webservice', 'trim|required');
         $this->form_validation->set_rules('inputUsername', 'Username Feeder', 'trim|required');
         $this->form_validation->set_rules('inputPassword', 'Password Feeder', 'required');
         //$ws = $this->input->post('inputWs', TRUE);
         $username = $this->input->post('inputUsername', TRUE);
         $password = $this->input->post('inputPassword', TRUE);
         $temp_ws = $this->input->post('db_ws');
         if ($this->form_validation->run() == TRUE) {
             $ws = $temp_ws == 'on' ? $this->dir_ws . 'live.php?wsdl' : $this->dir_ws . 'sandbox.php?wsdl';
             $ws_client = new nusoap_client($ws, true);
             $temp_proxy = $ws_client->getProxy();
             $temp_error = $ws_client->getError();
             if ($temp_proxy == NULL) {
                 $this->session->set_flashdata('error', 'Gagal melakukan koneksi ke Webservice Feeder.<br /><pre>' . $temp_error . '</pre>');
                 //$this->session->set_flashdata('error',$temp_error);
                 redirect(base_url());
             } else {
                 $temp_token = $temp_proxy->GetToken($username, $password);
                 if ($temp_token == 'ERROR: username/password salah') {
                     $this->session->set_flashdata('error', $temp_token);
                     redirect(base_url());
                 } else {
                     //$temp_npsn = substr($username, 0,6);
                     $temp_npsn = read_file('setting.ini');
                     //echo $temp_npsn;
                     $filter_sp = "npsn = '" . $temp_npsn . "'";
                     $temp_sp = $temp_proxy->getrecord($temp_token, 'satuan_pendidikan', $filter_sp);
                     //var_dump($temp_sp);
                     if ($temp_sp['result']) {
                         $id_sp = $temp_sp['result']['id_sp'];
                     } else {
                         $id_sp = '0';
                     }
                     $sessi = array('login' => TRUE, 'ws' => $ws, 'token' => $temp_token, 'username' => $username, 'password' => $password, 'url' => base_url(), 'kode_pt' => $temp_npsn, 'id_sp' => $id_sp);
                     $this->session->sess_expiration = '900';
                     //session expire 15 Minutes
                     $this->session->sess_expire_on_close = 'true';
                     $this->session->set_userdata($sessi);
                     //var_dump($sessi);
                     redirect('welcome');
                 }
             }
         }
     }
     tampil('__f_login');
 }
Ejemplo n.º 27
0
    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request)
    {
        $cfd = '<?xml version="1.0" encoding="UTF-8"?>
<cfdi:Comprobante
  xmlns:cfdi="http://www.sat.gob.mx/cfd/3"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.sat.gob.mx/cfd http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv3.xsd"
  version="3.0"
  Moneda="MXN" TipoCambio="1" serie="A" folio="1" fecha="2011-06-07T14:03:44"
  tipoDeComprobante="ingreso" formaDePago="PAGO EN UNA SOLA EXHIBICION"
  sello="4/Y7pItqbs6Gv+KRBEuaGinqIGHkJ1s0Xm4nk3WCblZZR4K2S1HtUviwJ7kRFdbZ9a1cOCYiQxyb+8HncWQfhk55LYzVAm7NlTlmu8ilktlZmoR/b7KE6BLnpAb9oS3FQmYV54pVtX8QCnQXkFK5SM7AcRfZLA1CpdWV+Heo4w0="
  noCertificado="00001000000102108856"
  certificado="MIIEUjCCAzqgAwIBAgIUMDAwMDEwMDAwMDAxMDIxMDg4NTYwDQYJKoZIhvcNAQEFBQAwggE2MTgwNgYDVQQDDC9BLkMuIGRlbCBTZXJ2aWNpbyBkZSBBZG1pbmlzdHJhY2nDs24gVHJpYnV0YXJpYTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExHzAdBgkqhkiG9w0BCQEWEGFjb2RzQHNhdC5nb2IubXgxJjAkBgNVBAkMHUF2LiBIaWRhbGdvIDc3LCBDb2wuIEd1ZXJyZXJvMQ4wDAYDVQQRDAUwNjMwMDELMAkGA1UEBhMCTVgxGTAXBgNVBAgMEERpc3RyaXRvIEZlZGVyYWwxEzARBgNVBAcMCkN1YXVodGVtb2MxMzAxBgkqhkiG9w0BCQIMJFJlc3BvbnNhYmxlOiBGZXJuYW5kbyBNYXJ0w61uZXogQ29zczAeFw0xMDEwMjIxNzMzMjNaFw0xNDEwMjIxNzM0MDNaMIHAMSgwJgYDVQQDEx9LQVJMQSBERUwgQ0FSTUVOIEFHVUlMQVIgREFWSUxBMSgwJgYDVQQpEx9LQVJMQSBERUwgQ0FSTUVOIEFHVUlMQVIgREFWSUxBMSgwJgYDVQQKEx9LQVJMQSBERUwgQ0FSTUVOIEFHVUlMQVIgREFWSUxBMQswCQYDVQQGEwJNWDEWMBQGA1UELRMNQVVESzgzMDUxMDRSMTEbMBkGA1UEBRMSQVVESzgzMDUxME1ERkdWUjAwMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD7OVMhM3MJpAERfrE37ZrMVcrt44DRb6tarJj5NhjzchJzoVJMyPlAd/2HchcqonfgsXikRRVVX2Atshi3WFvPhwQn4x2qG1huT0D5cC76zs8sTBbPSBf4aFqh3yDddssfBRh1EvkvadxNwY2itIs9m9u4oNJhSyidJRrHjDQrlwIDAQABo08wTTAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwID2DARBglghkgBhvhCAQEEBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwQGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQCfK8rC509yDqnqUdQV/uYdqqKD2MAdABCLrj2pi8ihSaWgOLfyRcM07LvFcTfAlrE/UrM7h+6Jb6qQk6p03LkI5gq8mCknco2J93g98WZbLs7quPbynDUMjocyBSTVwP0niHcEQNpXA+WD6NkaKIU0JxSXyMmkEGxQ9XiVRSFFYA2VT5TVq9gDESAcAxqpgqydc+W8KDk4VD6meQxajSj+xMP3X7DFoytVefdkfraP5sheW3Hw0xe6APLrf215htpSl2pwrPACmLCx9SxZIzoFdJbGNHvnLx5YvShrD2asegRvDLK/gNbmd+B1VVk5HnbmCEOdmks6tbRDkpU8OJiM"
  subTotal="10.00" descuento="0" total="11.60">
<cfdi:Emisor nombre="KARLA DEL CARMEN AGUILAR DAVILA" rfc="AUDK8305104R1" >
	<cfdi:DomicilioFiscal calle="ALDAMA" noExterior="9" colonia="SANTIAGO ZAPOTITLAN" municipio="TLAHUAC" estado="DISTRITO FEDERAL" pais="MEXICO" codigoPostal="75458"/>
</cfdi:Emisor>
<cfdi:Receptor nombre="Empresa de mentira S.A. de C.V." rfc="VEHR850430IY5">
	<cfdi:Domicilio calle="Otra calle" noExterior="426" colonia="Colonia 2" municipio="Otro municipio" estado="Estado" pais="MEXICO" codigoPostal="45678"/>
</cfdi:Receptor>
<cfdi:Conceptos>
	<cfdi:Concepto cantidad="2" unidad="Kilo" descripcion="Articulo de pruebas" valorUnitario="5.00" importe="10.0"/>
</cfdi:Conceptos>
<cfdi:Impuestos>
	<cfdi:Traslados>
		<cfdi:Traslado impuesto="IVA" tasa="16.000000" importe="16.000000/>
	</cfdi:Traslados>
</cfdi:Impuestos>
</cfdi:Comprobante>';
        $compressed = gzcompress($cfd, 3);
        $username = "******";
        $passwd = "fdelurrrb";
        $operation = "getCfdiTest";
        $wsdl = "https://cfdiws.sedeb2b.com/EdiwinWS/services/CFDi?wsdl";
        $params = array("user" => $username, "password" => $passwd, "file" => urlencode($compressed));
        $client = new nusoap_client($wsdl, 'wsdl');
        $client->soap_defencoding = "UTF-8";
        $err = $client->getError();
        print_r($err);
        if ($err) {
            //echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
            $this->logMessage("Constructor error", "err");
        }
        // Doc/lit parameters get wrapped
        $result = $client->call($operation, $params);
        print_r($result);
        exit;
        $this->logMessage($result['detail']['fault']['cod'] . "-" . $result['detail']['fault']['text']);
    }
Ejemplo n.º 28
-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);
             }
         }
     }
 }
Ejemplo n.º 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;
         }
     }
 }
 /**
  * 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.');
 }