function run_transaction($vars, $method = 'threeDSecureEnrolmentRequest')
 {
     $client = new soapclient($u = 'https://www.secpay.com/java-bin/services/SECCardService?wsdl', true);
     $err = $client->getError();
     if ($err) {
         return array('message' => sprintf(_PLUG_PAY_SECPAY_ERROR, $err));
     }
     $result = $client->call($method, $vars, "http://www.secpay.com");
     // Check for a fault
     if ($client->fault) {
         if ($err) {
             return array('message' => _PLUG_PAY_SECPAY_ERROR2 . join(' - ', array_values($result)));
         }
     } else {
         // Check for errors
         $err = $client->getError();
         if ($err) {
             return array('message' => sprintf(_PLUG_PAY_SECPAY_ERROR3, $err));
         } else {
             if ($result[0] == '?') {
                 $result = substr($result, 1);
             }
             $ret = $this->reparse($result);
             return $ret;
         }
     }
 }
Exemple #2
1
 *	Service: SOAP endpoint
 *	Payload: rpc/encoded
 *	Transport: https
 *	Authentication: none
 */
require_once '../lib/nusoap.php';
$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 soapclient('https://arcweb.esri.com/services/v2/AddressFinder', false, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$result = $client->call('getVersion', array(), 'http://arcweb.esri.com/v2', 'getVersion');
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    $err = $client->getError();
    if ($err) {
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        echo '<h2>Result</h2><pre>';
        print_r($result);
        echo '</pre>';
    }
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
 function PinPaymentEnquiry($_authority)
 {
     $soapclient = new soapclient('https://pec.shaparak.ir/pecpaymentgateway/eshopservice.asmx?wsdl', 'wsdl');
     if (!$soapclient or $err = $soapclient->getError()) {
         echo $err . "<br />";
         return FALSE;
     } else {
         $status = $_status;
         $params = array('pin' => $this->pin, 'status' => $status, 'authority' => $_authority);
         // to see if we can change it
         $sendParams = array($params);
         $res = $soapclient->call('PinPaymentEnquiry', $sendParams);
         $status = $res['status'];
         return $status;
     }
 }
Exemple #4
0
/**
 * The nuSoap client implementation
 * 
 * @return mixed The web service results
 */
function webServiceAction_nusoap(&$amfbody, $webServiceURI, $webServiceMethod, $args, $phpInternalEncoding)
{
    $installed = @(include_once AMFPHP_BASE . "lib/nusoap.php");
    if ($installed) {
        $soapclient = new soapclient($webServiceURI, 'wsdl');
        // create a instance of the SOAP client object
        $soapclient->soap_defencoding = $phpInternalEncoding;
        if (count($args) == 1 && is_array($args)) {
            $result = $soapclient->call($webServiceMethod, $args[0]);
            // execute without the proxy
        } else {
            $proxy = $soapclient->getProxy();
            //
            $result = call_user_func_array(array($proxy, $webServiceMethod), $args);
        }
        //echo $soapclient->getDebug();
        return $result;
    } else {
        trigger_error("nuSOAP is not installed correctly, it should be in lib/nusoap.php", E_USER_ERROR);
    }
}
<?php

// Pull in the NuSOAP code
require '../lib/nusoap/nusoap.php';
// Create the client instance
$client = new soapclient('http://wx.mim1314.com/raw/soap.php');
// Call the SOAP method
$result = $client->call('hello', array('8Scott'));
// Display the result
print_r($result);
Exemple #6
0
        $params = array('inputBase64' => base64_encode('You must encode the data you send; NuSOAP will automatically decode the data it receives'));
    } else {
        $params = array('inputBase64' => null);
    }
} else {
    echo 'Sorry, I do not know about method ' . $method;
    exit;
}
$client = new soapclient('http://www.scottnichol.com/samples/round2_base_server.php?wsdl&debug=1', true, $proxyHost, $proxyPort, $proxyUsername, $proxyPassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$client->useHTTPPersistentConnection();
echo '<h2>Execute ' . $method . '</h2>';
$result = $client->call($method, $params);
// 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(!is_bool($result) ? $result : ($result ? 'true' : 'false'));
Exemple #7
0
<html>
<head><meta charset="UTF-8"></head>
<body>
<?php 
require_once 'ws\\nusoap.php';
//Definicao da localização do arquivo WSDL
$wsdl = 'server2.php?wsdl';
//criação de uma instância do cliente
$client = new soapclient($wsdl, true);
//verifica se ocorreu erro na criação do objeto
$err = $client->getError();
if ($err) {
    echo "Erro no construtor<pre>" . $err . "</pre>";
}
//chamada do método SOAP
$result = $client->call('hello', array('Meu TESTE'));
//Verifica se ocorreu falha na chamada do método
if ($client->fault) {
    echo "Falha<pre>" . print_r($result) . "</pre>";
} else {
    //verifica se ocorreu erro
    $err = $client->getError();
    if ($err) {
        echo "Erro<pre>" . $err . "</pre>";
    } else {
        echo '<h2>Requisição</h2>';
        echo '<pre>' . htmlspecialchars($client->request) . '</pre>';
        echo '<h2>Resposta</h2>';
        echo '<pre>' . htmlspecialchars($client->response) . '</pre>';
        // Exibe mensagens para debug
        echo '<pre>' . htmlspecialchars($client->response) . '</pre>';
$_CLASS['core_user']->user_setup();
require_once SITE_FILE_ROOT . 'includes/nusoap/nusoap.php';
$google_license_key = "dJ5XAtRQFHIlbfutrovVj3TizF1Q2TXP";
$query = get_variable('query', 'POST');
$search_type = get_variable('search_type', 'POST', 0, 'int');
$limit = 10;
if (!$query) {
    script_close();
}
$query_command = $query;
if ($search_type === 1) {
    $query_command .= ' site:viperals.berlios.de';
}
$params = array('key' => (string) $google_license_key, 'q' => (string) $query_command, 'start' => (int) 0, 'maxResults' => (int) $limit, 'filter' => (bool) true, 'restricts' => (string) '', 'safeSearch' => (bool) false, 'lr' => (string) '', 'ie' => 'UTF-8', 'oe' => 'UTF-8');
$client = new soapclient('http://api.google.com/search/beta2');
$result = $client->call('doGoogleSearch', $params, 'urn:GoogleSearch');
if ($client->fault || $client->getError()) {
    script_close();
}
$pagination = generate_pagination('google_search&amp;query=' . urlencode($query) . '&amp;search_type=' . $search_type, $result['estimatedTotalResultsCount'], $limit, 0);
$count = count($result['resultElements']);
$num = 1;
for ($i = 0; $i < $count; $i++) {
    $_CLASS['core_template']->assign_vars_array('google_result', array('num' => $num, 'url' => $result['resultElements'][$i]['URL'], 'title' => $result['resultElements'][$i]['title'], 'snippet' => $result['resultElements'][$i]['snippet']));
    $num++;
}
unset($result);
$params = array('key' => (string) $google_license_key, 'phrase' => (string) $query);
$spelling_suggestion = $client->call('doSpellingSuggestion', $params, 'urn:GoogleSearch');
if (is_array($spelling_suggestion)) {
    $spelling_suggestion = false;
if (is_null($wsdl)) {
    $wsdl = new wsdl($wsdlurl, $proxyhost, $proxyport, $proxyusername, $proxypassword);
    $cache->put($wsdl);
} else {
    $wsdl->debug_str = '';
    $wsdl->debug('Retrieved from cache');
}
$client = new soapclient($wsdl, true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$inputAddresses[] = array('address' => '45 Liberty Blvd.', 'cityName' => 'Malvern', 'countryCode' => 'USA', 'postalCode' => '19355', 'stateName' => 'PA');
$geocodingrequest = array('addressesList' => $inputAddresses);
$params = array('request' => $geocodingrequest, 'check' => "{$login}|{$password}");
$result = $client->call('getLocationsList', $params);
// 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);
Exemple #10
0
-->
</style></head>

<body>
	<h1>Soap Test: Normalize</h1>
	<p>Sample Code</p>
	<pre class="code">
	<code>
require_once('{path_to_soap_library}/nusoap.php');
$c = new soapclient('{path_to_soap_server}/taxamatchsoap.php');
$value = $c->call(
		'normalize'
	,	array('string' => $item)
);
	</code>
	</pre>
<?php 
require_once '../../api/nusoap/lib/nusoap.php';
$p = pathinfo($_SERVER['REQUEST_URI']);
$c = new soapclient('http://' . $_SERVER['SERVER_NAME'] . "/" . $p['dirname'] . '/../../api/taxamatchsoap.php');
print "<p>Here are a list of normalized words.</p>";
$list = array("Carex", "Carex%0A", "Carex%20", "Barbatia (Mesocibota) bistrigata (Dunker, 1866)", "Barbatia (?) bistrigata (Dunker, 1866)", "Aphis [?] ficus Theobald, [1918]");
print "<ul>";
foreach ($list as $item) {
    $value = $c->call('normalize', array('string' => $item));
    print "<li>Input: <b>{$item}</b><br>Response: <b>{$value}</b><br><br></li>";
}
print "</ul>";
?>
</body>
</html>
require_once '../include/TicketNetworkWebServices.inc.php';
// require_once('err.php');
echo " Preparing for Import.......";
// create client object
$soapclient = new soapclient($serverpath);
$soapclient->timeout = 500;
$soapclient->response_timeout = 500;
//set soap Action
$method = 'GetTickets';
$soapAction = TND_WS_NAMESPACE . "/" . $method;
# TNServices.asmx?WSDL WorkS!!!!!
$param = array(websiteConfigID => $clientID, numberOfRecords => null, eventID => 721113, lowPrice => null, highPrice => null, ticketGroupID => null, requestedSplit => null, sortDescending => null);
echo "Invoking {$method} method..... ";
$soapclient->debug = 1;
// make the call
$result = $soapclient->call($method, $param, $namespace, $soapAction);
# echo "$soapAction: \nSTART_GET_ERROR\n" . $soapclient->getError() . "\nEND_GET_ERROR\nSTART_DEBUG_STR\n" . $soapclient->debug_str . "\nEND_DEBUG_STR\n";
echo "Done Calling {$soapAction}.";
if ($soapclient->getError() || $soapclient->fault) {
    echo "Error for {$soapAction}: \nSTART_GET_ERROR\n" . $soapclient->getError() . "\nEND_GET_ERROR\nSTART_DEBUG_STR\n" . $soapclient->debug_str . "\nEND_DEBUG_STR\n";
    die('ImportEventsFromTND.php exiting');
} else {
    echo "Importing data.... ";
    // if a fault occurred, output error info
    $num_tickets = 0;
    if (isset($fault)) {
        echo "Error: " . $fault;
    } else {
        if ($result) {
            if (isset($result['faultstring'])) {
                echo "<h2>Error:</h2>" . $result['faultstring'];
<?php

header('Content-Type:text/html;charset=utf-8');
require_once '../nusoaplib/nusoap.php';
require_once '../include/common.q.inc.php';
$client = new soapclient($weburl . 'wsdlPhoneCode.php?wsdl', true);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$client->soap_defencoding = 'UTF-8';
$params = array('checkPhone' => '13802501862');
$result = $client->call('getPhoneCode', $params);
//$p = $result;
//$login = $xml->cmmname;//
print_r($result);
// 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);
Exemple #13
0
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$person = array('firstname' => 'Willi', 'age' => 22, 'gender' => 'male');
$method = isset($_GET['method']) ? $_GET['method'] : 'function';
if ($method == 'function') {
    $call = 'hello';
} elseif ($method == 'instance') {
    $call = 'hellowsdl2.hello';
} elseif ($method == 'class') {
    $call = 'hellowsdl2..hello';
} else {
    $call = 'hello';
}
$result = $client->call($call, array('person' => $person));
// 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);
$dbname = "gses";
$username = "******";
$password = "******";
try {
    $conn = new PDO('mysql:host=' . $host . ';dbname=' . $dbname, $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die('ERROR: ' . $e->getMessage());
}
try {
    // $client = new soapclient("http://10.8.0.23:8787/rclctravel/services/cxfAuth?wsdl",true);
    // $seafarerId = "788078";
    // $seafarerId = "652782";
    $seafarerId = "246374";
    $client = new soapclient("http://10.8.0.23:8787/rclctravel/services/cxfAuth?wsdl", true);
    $response = $client->call('getEmployeeProfile', array('SeafarerId' => $seafarerId));
    // $client = new SoapClient("http://121.96.59.120:8787/rclctravel/services/cxfAuth?wsdl");
    // $response = $client->getActiveReservationsDetailed(array('SeafarerId' => $seafarerId));
    $result = $response['return'];
    $profile = $result['employeeProfShip'] ? $result['employeeProfShip'] : null;
    // print_r($result['schedulerEmail']);
    print_r($result);
    // print_r($profile['schedulerEmail']);
} catch (Exception $e) {
    echo $e->getMessage();
    $flights = null;
    $hotels = null;
}
?>

<?
// Pull in the NuSOAP code
require_once('../lib/nusoap.php');
// Create the client instance
$client = new soapclient('http://localhost/WSDPrac/GoogleMapApp/nusoap/pract7/bookWebserviceArrayRecord.php?wsdl', true);
$params = array(
    'name' => "122"
);
// Call the SOAP method
$result = $client->call('getallbooks',$params);


// 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>';
        $r = $result;

              }
function GetItemSearchParams()
{
    global $SubscriptionId;
    $itemSearchRequest = array('BrowseNode' => '53', 'ItemPage' => 1, 'SearchIndex' => 'Books', 'Sort' => 'salesrank');
    $itemSearch = array('SubscriptionId' => $SubscriptionId, 'Request' => array($itemSearchRequest));
    return $itemSearch;
}
function GetItemSearchParams2()
{
    global $SubscriptionId;
    $request = array("Keywords" => "postal stamps", "SearchIndex" => "Books");
    $itemSearch = array('SubscriptionId' => $SubscriptionId, 'Request' => $request);
    return $itemSearch;
}
if ($method == 'ItemSearch') {
    $result = $client->call('ItemSearch', array('body' => GetItemSearchParams()));
} elseif ($method == 'ItemSearch2') {
    $result = $client->call('ItemSearch', array('body' => GetItemSearchParams2()));
} elseif ($method == 'CartCreate') {
    $result = $client->call('CartCreate', array('body' => GetCartCreateParams()));
} else {
    echo "Unsupported method {$method}";
    exit;
}
// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    // Check for errors
Exemple #17
0
<?php

require '/var/www/html/nusoap/lib/nusoap.php';
$client = new soapclient('http://localhost/xmlgenerator/nusoap-estudo/server.php');
$result = $client->call('hello', array('name' => 'Frederich Van Voith'));
print_r($result);
Exemple #18
0
 function gatewayNotify($gatewaysLogPath)
 {
     // Get from bank
     $authority = $_GET['au'];
     $status = $_GET['rs'];
     $cmd_id = intval($_GET['cmd_id']);
     $cmd_total = intval($_GET['cmd_total']);
     // Set soap
     $url = $this->getdialogURL();
     if (extension_loaded('soap')) {
         $soapclient = new SoapClient($url);
     } else {
         require_once 'nusoap.php';
         $soapclient = new soapclient($url, 'wsdl');
     }
     // here we update our database
     $save_ok = 0;
     if ($authority) {
         $save_ok = 1;
     }
     // doing
     if ($status == 0 && $save_ok) {
         if (!$soapclient || ($err = $soapclient->getError())) {
             // this is unsucccessfull connection
             $commande = null;
             $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
             if (is_object($commande)) {
                 $this->handlers->h_oledrion_commands->setOrderFailed($commande);
                 $user_log = 'خطا در پرداخت - خطا در ارتباط با بانک';
             } else {
                 $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
                 $user_log = 'خطا در ارتباط با بانک - اطلاعات پرداخت شما نا معتبر است';
             }
         } else {
             //$status = 1;
             $params = array('pin' => $this->getParsianMid(), 'authority' => $authority, 'status' => $status);
             $sendParams = array($params);
             $res = $soapclient->call('PinPaymentEnquiry', $sendParams);
             $status = $res['status'];
             if ($status == 0) {
                 // this is a succcessfull payment
                 // we update our DataBase
                 $commande = null;
                 $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
                 if (is_object($commande)) {
                     if ($cmd_total == intval($commande->getVar('cmd_total'))) {
                         $this->handlers->h_oledrion_commands->validateOrder($commande);
                         $user_log = 'پرداخت شما با موفقیت انجام شد. محصول برای شما ارسال می شود';
                     } else {
                         $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
                         $user_log = 'اطلاعات پرداخت شما نا معتبر است';
                     }
                 }
                 $log .= "VERIFIED\t";
             } else {
                 // this is a UNsucccessfull payment
                 // we update our DataBase
                 $commande = null;
                 $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
                 if (is_object($commande)) {
                     $this->handlers->h_oledrion_commands->setOrderFailed($commande);
                     $user_log = 'خطا در پرداخت - وضعیت این پرداخت صحیح نیست';
                 } else {
                     $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
                     $user_log = 'وضعیت این پرداخت صحیح نیست - اطلاعات پرداخت شما نا معتبر است';
                 }
                 $log .= "{$status}\n";
             }
         }
     } else {
         // this is a UNsucccessfull payment
         $commande = null;
         $commande = $this->handlers->h_oledrion_commands->get($cmd_id);
         if (is_object($commande)) {
             $this->handlers->h_oledrion_commands->setOrderFailed($commande);
             $user_log = 'خطا در پرداخت - این پرداخت نا معتبر است';
         } else {
             $this->handlers->h_oledrion_commands->setFraudulentOrder($commande);
             $user_log = 'این پرداخت نا معتبر است - اطلاعات پرداخت شما نا معتبر است';
         }
         $log .= "{$status}\n";
     }
     // Ecriture dans le fichier log
     $fp = fopen($gatewaysLogPath, 'a');
     if ($fp) {
         fwrite($fp, str_repeat('-', 120) . "\n");
         fwrite($fp, date('d/m/Y H:i:s') . "\n");
         if (isset($status)) {
             fwrite($fp, "Transaction : " . $status . "\n");
         }
         fwrite($fp, "Result : " . $log . "\n");
         fwrite($fp, "Peyment note : " . $user_log . "\n");
         fclose($fp);
     }
     return $user_log;
 }
Exemple #19
0
<?php

// Pull in the NuSOAP code
require_once 'nusoap.php';
// Create the client instance
$client = new soapclient('http://localhost/phphack/hellowsdl2.php?wsdl', true);
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$person = array('firstname' => 'Willi', 'age' => 22, 'gender' => 'male');
$result = $client->call('hello', array('person' => $person));
// 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);
Exemple #20
0
	preg_match("~1 Colombian peso = ([0-9\.]+) Euros~", file_get_contents("http://www.google.com/search?hl=en&q=1+COP+in+EUR&btnG=Search"), $matchEUR);
	
	print_r($matchUSD);
	print_r($matchEUR);
	
	if ($matchUSD[1] > 0 && $matchEUR[1] > 0) {*/
	
	/*$soap = new SOAP_Client("http://xurrency.com/api.wsdl");
   	$cop_usd = $soap->getValue(1, 'cop', 'usd');
   	$cop_eur = $soap->getValue(1, 'cop', 'eur');*/
   	
	require('external/nusoap/nusoap.php'); 
	
	$cliente = new soapclient('http://xurrency.com/api.wsdl', true);
	
	$cop_usd = $cliente->call('getValue', array(1, 'usd', 'cop'));
	$cop_eur = $cliente->call('getValue', array(1, 'eur', 'cop'));
   	
   	if ($cop_usd != 0) $cop_usd = 1/$cop_usd;
   	if ($cop_eur != 0) $cop_eur = 1/$cop_eur;
   	
   	$logger->log('cop_usd', $cop_usd);
   	$logger->log('cop_eur', $cop_eur);
   	
   	if ($cop_usd && $cop_eur) {
		file_put_contents("config_currency.php", 
			'<?'."\n".
			'$config[\'currency\'][\'cop_usd\'] = '.$cop_usd.";\n".
			'$config[\'currency\'][\'cop_eur\'] = '.$cop_eur.";\n".
			'$config[\'currency\'][\'timestamp\'] = '.time().";\n".
			"\n".'?>');
$cache = new wsdlcache('.', 60);
$wsdl = $cache->get('http://www.xmethods.net/sd/2001/BNQuoteService.wsdl');
if (is_null($wsdl)) {
    $wsdl = new wsdl('http://www.xmethods.net/sd/2001/BNQuoteService.wsdl', $proxyhost, $proxyport, $proxyusername, $proxypassword);
    $cache->put($wsdl);
} else {
    $wsdl->debug_str = '';
    $wsdl->debug('Retrieved from cache');
}
$client = new soapclient($wsdl, true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$params = array('isbn' => '0060188782');
$result = $client->call('getPrice', $params);
// 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);
Exemple #22
0
    /** Task to refresh available dids cart items
    */
    function refresh() {
    	# read configuration
    	$this->config();
    	
    	# include the soap classes
    	include_once(PATH_INCLUDES."nusoap/lib/nusoap.php");
		# Include the voip class
		include_once(PATH_MODULES.'voip/voip.inc.php');
		$voip = new voip;
    	
    	$db =& DB();
		$client = new soapclient("http://didx.org/cgi-bin/WebGetListServer.cgi", false);

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

					unset($queue);
					while (is_array($result) && (list($k,$v)=each($result)) !== false) {
						if (is_array($v)) {
							if ($v[0] < 0) {
								# error occured, let's log it!
								$this->log_message('refresh', 'SOAP Response: '.$this->codes[$v[0]]);
							} else {
								if ($eparts[0] == '1') {
									;
								} else {
									$v[0] = "011".$v[0];
								}
								# got a phone number! let's insert it into the pool
								$cc = ""; $npa = ""; $nxx = ""; $e164 = "";
								if ($voip->e164($v[0], $e164, $cc, $npa, $nxx)) {
									unset($fields);
									$fields['country_code'] = $cc;
									$fields['voip_did_plugin_id'] = $this->id;
									if ($cc == '1') {
										$fields['station'] = substr($e164, 8);
										$fields['npa'] = $npa;
										$fields['nxx'] = $nxx;
									} else {
										$fields['station'] = substr($e164, 4 + strlen($cc));
									}
									$rs = $db->Execute( sqlSelect($db,"voip_pool","id","country_code=::".$cc.":: AND voip_did_plugin_id=::".$this->id.":: AND station=::".$fields['station']."::"));
									if ($rs->RecordCount() == 0) {
										$queue[] = sqlInsert($db,"voip_pool",$fields);
									}
								} else {
									$this->log_message('refresh', 'Could not parse the phone number returned: '.$v[0]);
								}
							}
						}
					}
					if (isset($queue) && is_array($queue) && count($queue)) {
						if ($bDelete) {
							# kill db entries
							$sql = "DELETE FROM ".AGILE_DB_PREFIX."voip_pool WHERE 
								voip_did_plugin_id=".$this->id." AND (account_id IS NULL or account_id=0)
								AND country_code=".$eparts[0]."
								AND (date_reserved IS NULL or date_reserved=0)";
							$db->Execute($sql);
							$bDelete = false;
						}
						foreach ($queue as $q) {
							$db->Execute($q);
						}
					}
				} # end foreach area
			} # end foreach entries
		}
    }
 *	Payload: rpc/encoded (params as an XML string; cf. wsdlclient3.php)
 *	Transport: http
 *	Authentication: none
 */
require_once '../lib/nusoap.php';
$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 soapclient('http://www.scottnichol.com/samples/hellowsdl2.php?wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$params = '<person xsi:type="tns:Person"><firstname xsi:type="xsd:string">Willi</firstname><age xsi:type="xsd:int">22</age><gender xsi:type="xsd:string">male</gender></person>';
$result = $client->call('hello', $params);
// 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);
	function tipocambio($tipo){

		switch($tipo){
			// parametros requeridos por el web service, 317 hace referencia al valor de compra, 318 hace referencia al valor de venta
			case "compra":
				$tipo=317;
			break;

			case "venta":
				$tipo=318;
			break;
		}

		require_once('nusoap/lib/nusoap.php');

		$instancia= new soapclient('http://indicadoreseconomicos.bccr.fi.cr/IndicadoresEconomicos/WebServices/wsIndicadoresEconomicos.asmx?WSDL', true);
		$parametros = array(
		"tcIndicador"=>$tipo,
		"tcFechaInicio"=>date("d/m/Y"),
		"tcFechaFinal"=>date("d/m/Y"),
		"tcNombre"=>"Coastal",
		"tnSubNiveles"=>"N"
		);

		$resultado = $instancia->call("ObtenerIndicadoresEconomicosXML",$parametros);
		foreach ($resultado as $x => $elemento){
			$r= $elemento;
		}
		$dolar=explode("NUM_VALOR",$r);
		$dolar[1]=str_replace("<","",$dolar[1]);
		$dolar[1]=str_replace(">","",$dolar[1]);
		$dolar[1]=str_replace("/","",$dolar[1]);
		return number_format($dolar[1],2);

		//return $r;
	}
// Pull in the NuSOAP code
require_once '../lib/nusoap.php';
// Create the client instance
$uri = 'http://localhost/WSDPrac/GoogleMapApp/nusoap/Prac/productWebservice.php?wsdl';
$client = new soapclient($uri, true);
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$person = array('firstname' => 'Willi', 'age' => 22, 'gender' => 'male');
//http://sourceforge.net/p/nusoap/discussion/193579/thread/8464efe4/#3c6d
$result = $client->call('GetProductsByCode', array());
// 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);
 *	Service: SOAP endpoint
 *	Payload: rpc/encoded
 *	Transport: http
 *	Authentication: none
 */
require_once '../lib/nusoap.php';
$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 soapclient('http://www.scottnichol.com/samples/getfile1.php?wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$result = $client->call('getFile', array('filename' => 'getfile1.php'));
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    $err = $client->getError();
    if ($err) {
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        echo '<h2>Result</h2><pre>' . htmlspecialchars($result, ENT_QUOTES) . '</pre>';
    }
}
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>';
Exemple #27
0
    //获取密码
    $content = trim($_POST[mess]);
    //获取短信内容
    $data = date("Y-m-d H:i:s");
    //获取时间
    $ip = getenv('REMOTE_ADDR');
    //获取IP地址
    while (list($name, $value) = each($_POST[colleague_tel])) {
        //读取要发送的电话号码
        if (is_numeric($value) == true) {
            //判断电话格式是否正确
            $mobilenumber = $value;
            //将获取的电话号码附给变量
            $msgtype = "Text";
            //指定短信为文本格式
            /*向数据库中添加发送短信的记录*/
            $sql = "insert into tb_short(short_ip,short_tel,short_tels,short_content,short_date,short_title)values('{$ip}','{$userid}','{$mobilenumber}','{$content}','{$data}','{$carrier}')";
            $rs = new com("adodb.recordset");
            $rs->open($sql, $conn, 3, 3);
            //执行添加语句
            /*------------------------*/
            include 'nusoap/lib/nusoap.php';
            //读取PHP类文件,实现短信的发送
            /*将数据以数组的形式添加到sendXml方法中*/
            $s = new soapclient('http://smsinter.sina.com.cn/ws/smswebservice0101.wsdl', 'WSDL');
            $s->call('sendXml', array('parameters' => array('carrier' => $carrier, 'userid' => $userid, 'password' => $password, 'mobilenumber' => $mobilenumber, 'content' => $content, 'msgtype' => $msgtype)));
            /*-------------------------------------*/
            echo "<script>alert('短信发送成功!');window.location.href='indexs.php?lmbs=连接短信';</script>";
        }
    }
}
Exemple #28
0
 */
require_once '../lib/nusoap.php';
$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 soapclient("http://api.google.com/search/beta2", false, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$client->soap_defencoding = 'UTF-8';
echo 'You must set your own Google key in the source code to run this client!';
exit;
$params = array('Googlekey' => 'set your own Google key', 'queryStr' => 'robotics', 'startFrom' => 0, 'maxResults' => 10, 'filter' => true, 'restrict' => '', 'adultContent' => true, 'language' => '', 'iencoding' => '', 'oendcoding' => '');
$result = $client->call("doGoogleSearch", $params, "urn:GoogleSearch", "urn:GoogleSearch");
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    $err = $client->getError();
    if ($err) {
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        echo '<h2>Result</h2><pre>';
        print_r($result);
        echo '</pre>';
    }
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
Exemple #29
0
 */
require_once '../lib/nusoap.php';
$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 soapclient('http://www.scottnichol.com/samples/hellowsdl3.wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$client->setUseCurl($useCURL);
$person = array('firstname' => 'Willi', 'age' => 22, 'gender' => 'male');
$name = array('name' => $person);
$result = $client->call('hello', $name);
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    $err = $client->getError();
    if ($err) {
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        echo '<h2>Result</h2><pre>';
        print_r($result);
        echo '</pre>';
    }
}
echo '<h2>Request</h2>';
/**
 * Checks if POG generator has been updated
 *
 * @return unknown
 */
function UpdateAvailable()
{
    $client = new soapclient($GLOBALS['configuration']['soap'], true);
    $params = array();
    $generatorVersion = base64_decode($client->call('GetGeneratorVersion', $params));
    if ($generatorVersion != $GLOBALS['configuration']['versionNumber'] . $GLOBALS['configuration']['revisionNumber']) {
        return true;
    } else {
        return false;
    }
}