示例#1
0
function queryRemoteServer($url, $method, $params, $toArray = true)
{
    global $config;
    include_once 'SOAP/Client.php';
    $client = new SOAP_Client($url);
    if (!$config['utf8']) {
        $params = utf8_encode_recursive($params);
    }
    $response = $client->call($method, $params, array('namespace' => 'urn:DILPSQuery'));
    if (is_a($response, 'SOAP_Fault')) {
        $fault = $response->getFault();
        $response = new stdClass();
        $err = new stdClass();
        $err->error = var_export($fault, true);
        $response->result = $err;
    }
    if ($toArray) {
        $response = _stdclass2array($response);
        if (!$config['utf8']) {
            $response = utf8_decode_recursive($response);
        }
        $result = $response['result'];
    } else {
        $result = $response->result;
    }
    return $result;
}
示例#2
0
/**
 * The PEAR::SOAP client implementation
 * 
 * @return mixed The web service results
 */
function webServiceAction_pear(&$amfbody, $webServiceURI, $webServiceMethod, $args, $phpInternalEncoding)
{
    $installed = @(include_once "SOAP/Client.php");
    // load the PEAR::SOAP implementation
    if ($installed) {
        $client = new SOAP_Client($webServiceURI);
        $response = $client->call($webServiceMethod, $args[0]);
        return $response;
    } else {
        trigger_error("PEAR::SOAP is not installed correctly", E_USER_ERROR);
    }
}
示例#3
0
 * @package    SOAP
 * @author     Shane Caraveo <*****@*****.**>   Port to PEAR and more
 * @author     Jan Schneider <*****@*****.**>       Maintenance
 * @copyright  2003-2007 The PHP Group
 * @license    http://www.php.net/license/2_02.txt  PHP License 2.02
 * @link       http://pear.php.net/package/SOAP
 */
/* Include SOAP_Client class. */
require_once 'SOAP/Client.php';
echo '<br><strong>wsdl:</strong>';
$wsdl = new SOAP_WSDL('http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl');
$soapclient = $wsdl->getProxy();
$ret = $soapclient->call('getQuote', array('symbol' => 'ibm'));
print_r($ret);
if (extension_loaded('overload')) {
    echo '<br><strong>overloaded:</strong>';
    $ret = $soapclient->getQuote('ibm');
    print_r($ret);
}
echo '<br><strong>non wsdl:</strong>';
$soapclient = new SOAP_Client('http://services.xmethods.net:80/soap');
$namespace = 'urn:xmethods-delayed-quotes';
/* Some SOAP servers require a Soapaction HTTP header.  PEAR::SOAP does not
 * use them in any way, other to send them if you supply them.  soapaction is
 * deprecated in later SOAP versions. */
$soapaction = 'urn:xmethods-delayed-quotes#getQuote';
$ret = $soapclient->call('getQuote', array('symbol' => 'ibm'), $namespace, $soapaction);
print_r($ret);
?>
</html></body>
示例#4
0
 * USAGE : http://domainname/A2Billing_UI/api/SOAP/soap-card-client.php
 *
 * http://localhost/~areski/svn/a2billing/trunk/A2Billing_UI/api/SOAP/soap-card-client.php
 *
 ****************************************************************************/
include "../../lib/defines.php";
require 'SOAP/Client.php';
$security_key = API_SECURITY_KEY;
$endpoint = 'http://localhost/~areski/svn/asterisk2billing/trunk/A2Billing_UI/api/SOAP/soap-card-server.php';
// ADD ON THE SPEC SECURITY KEY
$card = new SOAP_Client($endpoint);
//	#############   Reservation_Card   #############
echo "<hr>#############   Reservation_Card : {$ans['2']}  #############   </hr>";
$method = 'Reservation_Card';
$params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'card_id' => '', 'cardnumber' => '8995713909');
$ans = $card->call($method, $params);
print_r($ans);
exit;
//	#############   Activation_Card   #############
echo "<hr>#############   Activation_CARD : {$ans['2']}  #############   </hr>";
$method = 'Activation_Card';
//Activation_Card($security_key, $transaction_code, $card_id, $cardnumber)
$params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'card_id' => '', 'cardnumber' => '8995713909');
$ans = $card->call($method, $params);
print_r($ans);
exit;
//	#############  Batch_Activation_Card   #############
echo "<hr>#############   Batch_Activation_Card : {$ans['2']}  #############   </hr>";
$method = 'Batch_Activation_Card';
$params = array('security_key' => md5($security_key), 'transaction_code' => 'mytransaction_code', 'begin_card_id' => '2', 'end_card_id' => '4');
$ans = $card->call($method, $params);
示例#5
0
 /**
  * Override SOAP_Client::call() to always add our security header
  * first.
  */
 function &call($method, &$params, $namespace = false, $soapAction = false)
 {
     // Create the security header.
     $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Username', '', $this->_profile->getAPIUsername()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Password', '', $this->_profile->getAPIPassword()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Signature', '', $this->_profile->getSignature()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())), array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI')));
     return parent::call($method, $params, $namespace, $soapAction);
 }
示例#6
0
// tradeTitle : added by this routine
$transaction['tradeTitle'] = "PHP transaction: see description";
// tradeDescription
$transaction['tradeDescription'] = 'test';
// tradeDestination : ddawg
$transaction['tradeDestination'] = 'ddawg';
// tradeItem : test to see variables
// tradeSource : manager
$transaction['tradeSource'] = 'manager';
//
// call ordinary transaction
// check_user_and_add_trade ($transaction['toregistry'],'om_trades',&$transaction,$token)  ;
// $ret = $soapclient->call("echoStringSimple",
//                         $params = array("inputStringSimple"=>"this is a test string"),
//                         $options);
$ret = $soapclient->call("wrapper_for_check_user_and_add_trade", $params = 'chelsea', 'om_trades', array('fromregistry' => 'chelsea', 'home' => '', 'subaction' => 'om_trades', 'toregistry' => 'chelsea', 'tradeAmount' => '23', 'tradeCurrency' => 'ducket', 'tradeDate' => '2006-01-01', 'tradeTitle' => "PHP transaction: see description", 'tradeDescription' => 'test', 'tradeDestination' => 'ddawg', 'tradeSource' => 'manager'), $token, $options, null);
/* $ret = $soapclient->call("Cclite#wrapper_for_check_user_and_add_trade",
                          $params = 'chelsea','om_trades',
			   'fromregistry',
			   'chelsea', 
   			   'home',
 			   ' ',  
   			   'subaction', 
                           'om_trades', 
   			   'toregistry', 
			   'chelsea', 
   			   'tradeAmount',
			    '23', 
   			   'tradeCurrency', 
                           'ducket', 
   			   'tradeDate', 
示例#7
0
//
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group                                |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license,      |
// | that is bundled with this package in the file LICENSE, and is        |
// | available at through the world-wide-web at                           |
// | http://www.php.net/license/2_02.txt.                                 |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Authors: Shane Caraveo <*****@*****.**>                           |
// +----------------------------------------------------------------------+
//
// $Id$
//
// include soap client class
include "SOAP/Client.php";
$soapclient = new SOAP_Client("mailto:user@domain.com");
$options = array('namespace' => 'http://soapinterop.org/', 'from' => '*****@*****.**', 'host' => 'localhost');
$return = $soapclient->call("echoString", array("inputString" => "this is a test"), $options);
$return = $soapclient->call("echoStringArray", array('inputStringArray' => array('good', 'bad', 'ugly')), $options);
// don't expect much of a result!
print_r($return);
print "<br>\n" . $soapclient->wire;
?>

                'id_callplan' => $id_callplan,
                'id_didgroup' => $id_didgroup,
                'units' => $units,
                'accountnumber_len' => $accountnumber_len,
                'balance' => $balance,
                'activated' => $activated,
                'status' => $status,
                'simultaccess' => $simultaccess,
                'currency' => $currency,
                'typepaid' => $typepaid,
                'sip_buddy' => $sip_buddy,
                'iax_buddy' => $iax_buddy,
                'language' => $language,
                'voicemail_enabled' => $voicemail_enabled,
                'country' => $country,
                );

$ans = $callback -> call($method, $params);

print_r($ans);

$time_end = microtime(true);
$time = $time_end - $time_start;


echo ("<br/>>>>>>>> ACCOUNT CREATED : $units <br/>");
echo (">>>>>>> RUNNING TIME = $time secs <br/><br/><br/><br/>");



示例#9
0
<?php

include 'SOAP/Client.php';
$proxy = 'http://localhost/cgi-bin/dada/extras/scripts/subscribe_soap_server.cgi';
$namespace = 'DadaMail';
$email = '*****@*****.**';
$list = 'listshortname';
$fields = array();
$params = array();
$options = array('namespace' => $namespace, 'trace' => 1);
$client = new SOAP_Client($proxy);
$params2 = array($list, $email, $fields);
$result = array();
$result = $client->call("subscribe", $params2, $options);
echo "<pre>\n";
echo "\t* Email: {$email}\n";
echo "\t* List: {$list}\n\n";
echo "Subscription Check: {$result['0']}\n";
$errors = $result[1];
if ($errors) {
    echo "Errors: \n";
    while (list($key, $value) = each($errors)) {
        echo "\t* Error: {$key}\n";
    }
}
echo "done.\n";
示例#10
0
echo "</pre>";

 $soapclient = new SOAP_Client('http://yelizhi.com.vn/ws/employee.php?wsdl');
 $ret = $soapclient->call('listEmployees',
							$params = array( 																		
									"TimeZone"		=> '+07:00', 																								
										'AuthenUser' 	=> 'admin', 
									'AuthenPass' 	=> '21232F297A57A5A743894A0E4A801FC3'),
                         $options);	
echo "---------------listAccount-------------";
echo "<pre>";
print_r($ret);
echo "</pre>";*/
//$soapclient = new SOAP_Client('http://yelizhi.com.vn/ws/transfer.php?wsdl');
$soapclient = new SOAP_Client('http://yelizhi.com.vn/ws/withdrawal_deposit.php?wsdl');
$ret = $soapclient->call('approveWithdrawalDeposit', $params = array("ID" => 67, "WDType" => 'D', "UpdatedBy" => 'chi.dl', "ApproveDate" => '2007-07-03', 'AuthenUser' => 'admin', 'AuthenPass' => '21232F297A57A5A743894A0E4A801FC3'), $options);
echo "---------------approveWithdrawalDeposit-------------";
echo "<pre>";
print_r($ret);
echo "</pre>";
/*$ret = $soapclient->call('addWithdrawalDeposit',
							$params = array( 
									"AccountID" 	=> 1, 
									"AmountMoney" 	=> 10000000, 
									"WDDate" 		=> '2007-06-20',
									"WDType" 		=> 'D',
									"Note" 			=> 'Rut tien test bravo', 	
									"CardNo" 		=> '123796590', 
									"CreatedBy" 	=> 'chi.dl', 
									'AuthenUser' 	=> 'admin', 
									'AuthenPass' 	=> '21232F297A57A5A743894A0E4A801FC3'),
示例#11
0
文件: client.php 项目: alex-k/velotur
// +----------------------------------------------------------------------+
// | Authors: Shane Caraveo <*****@*****.**>                           |
// +----------------------------------------------------------------------+
//
// $Id: client.php,v 1.10 2005/03/10 23:16:39 yunosh Exp $
//
include "SOAP/Client.php";
/**
 * this client runs against the example server in SOAP/example/server.php
 * it does not use WSDL to run these requests, but that can be changed easily by simply
 * adding '?wsdl' to the end of the url.
 */
$soapclient = new SOAP_Client("http://localhost/SOAP/example/server.php");
// this namespace is the same as declared in server.php
$options = array('namespace' => 'urn:SOAP_Example_Server', 'trace' => 1);
$ret = $soapclient->call("echoStringSimple", $params = array("inputStringSimple" => "this is a test string"), $options);
#print $soapclient->__get_wire();
print_r($ret);
echo "<br>\n";
$ret = $soapclient->call("echoString", $params = array("inputString" => "this is a test string"), $options);
print_r($ret);
echo "<br>\n";
$ret = $soapclient->call("divide", $params = array("dividend" => 22, "divisor" => 7), $options);
# print $soapclient->__get_wire();
if (PEAR::isError($ret)) {
    print "Error: " . $ret->getMessage() . "<br>\n";
} else {
    print "Quotient is " . $ret . "<br>\n";
}
$ret = $soapclient->call("divide", $params = array("dividend" => 22, "divisor" => 0), $options);
if (PEAR::isError($ret)) {
 function &call($method, &$params, $namespace = false, $soapAction = false)
 {
     // Create the empty security header if using permissioning, pass the auth token, auth signature, auth timestamp as httpheader
     if (!empty($this->_profile->_authSignature)) {
         global $authstringvar;
         $authstringvar = CallerServices::buildAuthString($this->_profile->_authToken, $this->_profile->_authSignature, $this->_profile->_authTimestamp);
         $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', $tmp, array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI')));
     } else {
         $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Username', '', $this->_profile->getAPIUsername()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Password', '', $this->_profile->getAPIPassword()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Signature', '', $this->_profile->getSignature()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())), array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI')));
     }
     return parent::call($method, $params, $namespace, $soapAction);
 }
示例#13
0
<?php

/**
 * SMTP client.
 *
 * PHP versions 4 and 5
 *
 * LICENSE: This source file is subject to version 2.02 of the PHP license,
 * that is bundled with this package in the file LICENSE, and is available at
 * through the world-wide-web at http://www.php.net/license/2_02.txt.  If you
 * did not receive a copy of the PHP license and are unable to obtain it
 * through the world-wide-web, please send a note to license@php.net so we can
 * mail you a copy immediately.
 *
 * @category   Web Services
 * @package    SOAP
 * @author     Shane Caraveo <*****@*****.**>   Port to PEAR and more
 * @author     Jan Schneider <*****@*****.**>       Maintenance
 * @copyright  2003-2007 The PHP Group
 * @license    http://www.php.net/license/2_02.txt  PHP License 2.02
 * @link       http://pear.php.net/package/SOAP
 */
/* Include SOAP_Client class. */
require_once 'SOAP/Client.php';
$soapclient = new SOAP_Client('mailto:user@domain.com');
$options = array('namespace' => 'http://soapinterop.org/', 'from' => '*****@*****.**', 'host' => 'localhost');
$return = $soapclient->call('echoString', array('inputString' => 'this is a test'), $options);
$return = $soapclient->call('echoStringArray', array('inputStringArray' => array('good', 'bad', 'ugly')), $options);
/* Don't expect much of a result! */
print_r($return);
echo $soapclient->wire;
示例#14
0
<?php

require_once 'SOAP/Client.php';
$addr = "10.10.20.67";
$port = 7001;
$proto = "tcp";
$host = "" . $proto . "://" . $addr . ":" . $port;
$soapclient = new SOAP_Client($host, false, $port);
$a = array("nil" => "true");
$method = "listDomains";
$ret = $soapclient->call($method, array($a));
if (is_a($ret, 'PEAR_Error')) {
    echo $soapclient->getLastRequest() . "\n";
    echo 'Error: ' . $ret->getMessage() . "\n";
} else {
    print_r($ret);
}
示例#15
0
文件: SOAP.php 项目: rhertzog/lcs
 /**
  * Fetch data from SOAP service
  *
  * Requests the SOAP service for the given username/password
  * combination.
  *
  * @param  string Username
  * @param  string Password
  * @return mixed Returns the SOAP response or false if something went wrong
  */
 function fetchData($username, $password)
 {
     // check if all required options are set
     if (array_intersect($this->_requiredOptions, array_keys($this->_options)) != $this->_requiredOptions) {
         return false;
     } else {
         // create a SOAP client and set encoding
         $soapClient = new SOAP_Client($this->_options['endpoint']);
         $soapClient->setEncoding($this->_options['encoding']);
     }
     // assign username and password fields
     $usernameField = new SOAP_Value($this->_options['usernamefield'], 'string', $username);
     $passwordField = new SOAP_Value($this->_options['passwordfield'], 'string', $password);
     $SOAPParams = array($usernameField, $passwordField);
     // assign optional features
     foreach ($this->_features as $fieldName => $fieldValue) {
         $SOAPParams[] = new SOAP_Value($fieldName, 'string', $fieldValue);
     }
     // make SOAP call
     $this->soapResponse = $soapClient->call($this->_options['method'], $SOAPParams, array('namespace' => $this->_options['namespace']));
     if (!PEAR::isError($this->soapResponse)) {
         if ($this->_options['matchpasswords']) {
             // check if passwords match
             if ($password == $this->soapResponse->{$this->_options['passwordfield']}) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return true;
         }
     } else {
         return false;
     }
 }
示例#16
0
 *
 * LICENSE: This source file is subject to version 2.02 of the PHP license,
 * that is bundled with this package in the file LICENSE, and is available at
 * through the world-wide-web at http://www.php.net/license/2_02.txt.  If you
 * did not receive a copy of the PHP license and are unable to obtain it
 * through the world-wide-web, please send a note to license@php.net so we can
 * mail you a copy immediately.
 *
 * @category   Web Services
 * @package    SOAP
 * @author     Shane Caraveo <*****@*****.**>   Port to PEAR and more
 * @author     Jan Schneider <*****@*****.**>       Maintenance
 * @copyright  2003-2007 The PHP Group
 * @license    http://www.php.net/license/2_02.txt  PHP License 2.02
 * @link       http://pear.php.net/package/SOAP
 */
require_once 'SOAP/Client.php';
/* Client. */
$soapclient = new SOAP_Client('tcp://127.0.0.1:82');
/* Namespace. */
$options = array('namespace' => 'urn:SOAP_Example_Server', 'trace' => true);
/* One. */
$params = array('string' => 'this is string 1');
$ret1 = $soapclient->call('echoString', $params, $options);
echo "WIRE: \n" . $soapclient->getWire();
print_r($ret1);
/* Two. */
$params = array('string' => 'this is string 2');
$ret2 = $soapclient->call('echoString', $params, $options);
echo "WIRE: \n" . $soapclient->getWire();
print_r($ret2);
 function insertTwoFirmReply2Firm($TRANSDATE, $TRANSDESC, $SRCACCOUNTID, $CANCELLFLAG, $OrderCrossID, $CreatedBy, $AccountNo, $StockID, $Amount, $Price)
 {
     $function_name = 'insertTwoFirmReply2Firm';
     $struct = '{urn:' . $this->class_name . '}' . $function_name . 'Struct';
     if (authenUser(func_get_args(), $this, $function_name) > 0) {
         return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
     }
     try {
         // if cancelflag equal C, call sp_hnx_TwoFirm_Reply2Firm_insert - do not insert LOBuyingOrder
         if ($CANCELLFLAG != "C") {
             $soapclient = new SOAP_Client(WS_ORDER);
             $re = $soapclient->call('insertLOBuyingOrderForHNX', $params = array("AccountNo" => $AccountNo, 'StockID' => $StockID, 'OrderQuantity' => $Amount, 'OrderPrice' => $Price, 'Session' => '4', 'FromTypeID' => '1', 'OrderDate' => $TRANSDATE, "CreatedBy" => $CreatedBy, "AuthenUser" => 'ba.nd', "AuthenPass" => md5('hsc080hsc')));
             if ($re->error_code != "0") {
                 $this->_ERROR_CODE = $re->error_code;
                 return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
             } else {
                 $this->_MDB2_WRITE = newInitWriteDB();
                 $query = sprintf("CALL sp_hnx_TwoFirm_Reply2Firm_insert('%s', '%s', %u, '%s', %u, '%s', %u)", $TRANSDATE, $TRANSDESC, $SRCACCOUNTID, $CANCELLFLAG, $OrderCrossID, $CreatedBy, $re->items[0]->ID);
                 $rs = $this->_MDB2_WRITE->extended->getRow($query);
             }
         } else {
             // cancelflag == C
             $this->_MDB2_WRITE = newInitWriteDB();
             $query = sprintf("CALL sp_hnx_TwoFirm_Reply2Firm_insert('%s', '%s', %u, '%s', %u, '%s', %u)", $TRANSDATE, $TRANSDESC, $SRCACCOUNTID, $CANCELLFLAG, $OrderCrossID, $CreatedBy, $re->items[0]->ID);
             $rs = $this->_MDB2_WRITE->extended->getRow($query);
         }
         if (empty($rs)) {
             $this->_ERROR_CODE = 30790;
         } else {
             $result = $rs['varError'];
             if ($result < 0) {
                 switch ($result) {
                     case '-1':
                         $this->_ERROR_CODE = 30791;
                         break;
                     case '-2':
                         $this->_ERROR_CODE = 30792;
                         break;
                     case '-3':
                         $this->_ERROR_CODE = 30793;
                         break;
                     case '-4':
                         $this->_ERROR_CODE = 30794;
                         break;
                     case '-5':
                         $this->_ERROR_CODE = 30795;
                         break;
                     default:
                         $this->_ERROR_CODE = $result;
                 }
                 // switch
             } else {
                 $this->items[0] = new SOAP_Value('item', $struct, array("ID" => new SOAP_Value("ID", "string", $result)));
             }
             $content = date("d/m/Y H:i:s") . "\t" . $query . "\t--> " . $this->_ERROR_CODE;
             another_write_log($function_name, $content, 'directly_tranfer');
         }
     } catch (Exception $e) {
         $this->_ERROR_CODE = $e->getMessage();
     }
     return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this);
 }
示例#18
0
function OVH()
{
    global $ovh_status;
    // -- Detection des arguments --
    $args = func_get_args();
    if (sizeof($args) < 2) {
        return false;
    }
    $api = $args[0];
    if (!is_string($api)) {
        return false;
    }
    $ssid = $args[1];
    if (sizeof($args) > 2) {
        $params = $args[2];
    } else {
        $params = null;
    }
    if (is_array($ssid)) {
        list($params, $ssid) = array($ssid, $params);
    }
    if (is_array($ssid) || !is_array($params) && !is_null($params)) {
        return false;
    }
    if (!is_null($ssid)) {
        $full_params[] = $ssid;
    }
    if (!is_null($params)) {
        $full_params[] = $params;
    }
    // -- Temporisation --
    $delay = 250;
    list($usec, $sec) = explode(" ", microtime());
    $t = round((double) $usec * 1000 + (double) $sec * 1000);
    static $time = 0;
    if ($time == 0) {
        $time = $t - $delay;
    }
    if ($t - $time < $delay) {
        usleep($delay - ($t - $time));
    }
    $time = $t;
    // -- Initialisation du client SOAP --
    static $soap_client, $options;
    static $init = false;
    $return = false;
    if (!$init) {
        require "SOAP/Client.php";
        $soap_client = new SOAP_Client("http://ovh.com:1663");
        $soap_client->setEncoding("UTF-8");
        $options = array("namespace" => "urn:manager", "trace" => 1, "timeout" => 10);
        $init = true;
    }
    // -- Verrouillage --
    if ($api == "ClearNicSessions") {
        if (defined("OVHCLEARNIC")) {
            return $return;
        } else {
            define("OVHCLEARNIC", true);
        }
    }
    // -- Execution de la fonction API --
    $result = $soap_client->call($api, $full_params, $options);
    if (!PEAR::isError($result)) {
        $result = get_object_vars($result);
        // -- Conversion des objets en tableaux --
        if (!function_exists('OVH_OBJ_CONV')) {
            function OVH_OBJ_CONV($r)
            {
                if (is_object($r)) {
                    $r = get_object_vars($r);
                }
                if (is_array($r)) {
                    $r = array_map('OVH_OBJ_CONV', $r);
                }
                return $r;
            }
        }
        $result = array_map('OVH_OBJ_CONV', $result);
        // -- Traitement du resultat --
        if (!isset($result["status"]) && isset($result["value"])) {
            if (is_numeric($result["value"])) {
                $ovh_status = $result["value"];
            } else {
                $ovh_status = $result["status"];
            }
        } else {
            $ovh_status = $result["status"];
        }
        if (isset($result["ie"])) {
            $ovh_status .= "/" . $result["ie"];
        }
        if (isset($result["msg"])) {
            $ovh_status .= " - " . $result["msg"];
        }
        switch ($result["status"]) {
            case 100:
                $return = $result;
                break;
            case 304:
                if (ovh("ClearNicSessions", $params) !== false) {
                    $return = ovh($api, $ssid, $params);
                }
                break;
        }
    }
    return $return;
}
示例#19
0
 function soapRequest($getDataRequest)
 {
     $returnValue = '';
     $url = $this->hostname . $this->requestPath;
     $soapclient = new SOAP_Client($url);
     $soapclient->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
     $soapclient->setOpt('timeout', $this->soapTimeout);
     $params = array('arg0' => $getDataRequest);
     $returnValue = $soapclient->call($this->rpcMethod, $params);
     $xmlArr = $this->XML_unserialize($returnValue);
     $debug = FALSE;
     if ($this->lsfDebug) {
         $debug = TRUE;
     } else {
         $get = t3lib_div::_GET();
         if (isset($get['debug'])) {
             $debug = TRUE;
         }
     }
     if ($debug) {
         t3lib_utility_Debug::debugInPopUpWindow($params, 'Soap-Anfrage');
         t3lib_utility_Debug::debugInPopUpWindow($xmlArr, 'Soap-Response');
     }
     return $xmlArr;
 }
示例#20
0
文件: client.php 项目: gmgj/gjsoap
 * simply adding '?wsdl' to the end of the url. */
$soapclient = new SOAP_Client('http://localhost/SOAP/example/server.php');
/* Set a few options. */
$options = array();
/* This namespace is the same as declared in server.php. */
$options['namespace'] = 'urn:SOAP_Example_Server';
/* Trace the communication for debugging purposes, so we can later inspect the
 * data with getWire(). */
$options['trace'] = true;
/* Uncomment the following lines if you want to use Basic HTTP
 * Authentication. */
// $options['user'] = '******';
// $options['pass'] = '******';
header('Content-Type: text/plain');
/* Calling echoStringSimple. */
$ret = $soapclient->call('echoStringSimple', array('inputStringSimple' => 'this is a test string'), $options);
// echo $soapclient->getWire();
print_r($ret);
echo "\n";
/* Calling echoString. */
$ret = $soapclient->call('echoString', array('inputString' => 'this is a test string'), $options);
// echo $soapclient->getWire();
print_r($ret);
echo "\n";
/* Calling divide with valid parameters. */
$ret = $soapclient->call('divide', array('dividend' => 22, 'divisor' => 7), $options);
// echo $soapclient->getWire();
if (PEAR::isError($ret)) {
    echo 'Error: ' . $ret->getMessage();
} else {
    echo 'Quotient is ' . $ret;
示例#21
0
<?php

require 'SOAP/Client.php';
/**
 * This client runs against the example server in SOAP/example/server.php.  It
 * does not use WSDL to run these requests, but that can be changed easily by
 * simply adding '?wsdl' to the end of the url.
 */
$soapclient = new SOAP_Client('http://www3.hs-esslingen.de/qislsf/services/dbinterface');
$rpcMethod = 'getDataXML';
$getDataRequest = '<SOAPDataService>
		      <general>
		        <object>modulList</object>
		      </general>
		      <condition>
		      <abschluss>84</abschluss>
		      <studiengang>BSA</studiengang>
		      <version>2</version>
		      </condition>
		   </SOAPDataService>';
$soapclient->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
$params = array('arg0' => $getDataRequest);
$returnValue = $soapclient->call($rpcMethod, $params);
print_r($returnValue);
示例#22
0
//
// include soap client class
include "SOAP/Client.php";
print "<br>\n<strong>wsdl:</strong>";
$wsdl = new SOAP_WSDL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
$soapclient = $wsdl->getProxy();
print_r($soapclient->getQuote("ibm"));
print "\n\n";
if (extension_loaded('overload')) {
    print "\n<br><strong>overloaded:</strong>";
    $ret = $soapclient->getQuote("ibm");
    print_r($ret);
    print "\n\n";
}
unset($soapclient);
print "\n<br><strong>non wsdl:</strong>";
$soapclient = new SOAP_Client("http://services.xmethods.net:80/soap");
$namespace = "urn:xmethods-delayed-quotes";
/**
 * some soap servers require a Soapaction http header.  PEAR::SOAP does
 * not use them in any way, other to send them if you supply them.
 * soapaction is deprecated in later SOAP versions.
 */
$soapaction = "urn:xmethods-delayed-quotes#getQuote";
$ret = $soapclient->call("getQuote", array("symbol" => "ibm"), $namespace, $soapaction);
print_r($ret);
print "\n\n";
unset($soapclient);
?>
</html></body>
示例#23
0
<?php

require_once "SOAP/Client.php";
require_once "SOAP/test/test.utility.php";
require_once "SOAP/Value.php";
$filename = 'attachment.php';
$v = new SOAP_Attachment('test', 'text/plain', $filename);
$methodValue = new SOAP_Value('testattach', 'Struct', array($v));
$client = new SOAP_Client('mailto:user@domain.com');
# calling with mime
$resp = $client->call('echoMimeAttachment', array($v), array('attachments' => 'Mime', 'namespace' => 'http://soapinterop.org/', 'from' => '*****@*****.**', 'host' => 'smtp.domain.com'));
print $client->wire . "\n\n\n";
print_r($resp);
# calling with DIME
$resp = $client->call('echoMimeAttachment', array($v));
# DIME has null spaces, change them so we can see the wire
$wire = str_replace("", '*', $client->wire);
print $wire . "\n\n\n";
print_r($resp);
示例#24
0
	<?php 
        session_unregister('Error');
    } else {
        $dab =& new CDAB();
        $soapclient = new SOAP_Client('http://172.25.2.99:8250/ws/exchange.php?wsdl');
        $soapclient->setOpt("timeout", 100);
        $options = array('namespace' => 'urn:CExchange', 'trace' => 1);
        $params = array('OrderDate' => date("Y-m-d"), 'BankID' => 2, 'AuthenUser' => 'ba.nd', 'AuthenPass' => md5('hsc080hsc'));
        if ($_REQUEST['Type'] > 0) {
            switch ($_REQUEST['Type']) {
                case '1':
                    $re = $dab->releaseBidFile("/home/vhosts/bos/htdocs/", "getBid.xml");
                    break;
                case '2':
                    $re = $soapclient->call('getAuctionForXML', $params, $options);
                    break;
                case '3':
                    $re = $soapclient->call('getAllCancelBidForXML', $params, $options);
                    break;
                case '4':
                    $re = $soapclient->call('getAllSellForXML', $params, $options);
                    break;
            }
            //switch
            session_register('Error');
            $_SESSION['Error'] = $re;
            header("Location: file.php");
            exit;
        }
    }
define("DB_HOST", "172.25.2.103");
define("DB_HOST_WRITE", "172.25.2.103");
define("DB_TYPE", "mysqli");
define("DB_NAME", "esms");
define("DB_USERNAME", "epsesms_read");
define("DB_PASSWORD", "root@epsesms_read");
define("DB_DNS", DB_TYPE . "://" . DB_USERNAME . ":" . DB_PASSWORD . "@" . DB_HOST . "/" . DB_NAME);
define("DB_DNS_WRITE", DB_TYPE . "://" . DB_USERNAME . ":" . DB_PASSWORD . "@" . DB_HOST_WRITE . "/" . DB_NAME);
//initialize MDB2
$mdb2 =& MDB2::factory(DB_DNS_WRITE);
$mdb2->loadModule('Extended');
$mdb2->loadModule('Date');
$mdb2->setFetchMode(MDB2_FETCHMODE_ASSOC);
// $date=date("Y-m-d");
$date = '2010-10-18';
$query = sprintf("CALL sp_executeMoneyTTBT('%s')", $date);
$account_lists = $mdb2->extended->getAll($query);
$mdb2->disconnect();
write_my_log('MoneyTTBT', $query . '  varerror ' . $account_lists[0]['varerror'] . ' ' . date('Y-m-d h:i:s'));
if ($account_lists[0]['varerror'] == 0) {
    require 'SOAP/Client.php';
    $soapclient = new SOAP_Client('http://202.87.214.213/ws/bravo.php?wsdl');
    $ret = $soapclient->call('SellingValueAndFeeListForBravo', $params = array("TradingDate" => $date, 'AuthenUser' => 'ba.nd', 'AuthenPass' => md5('hsc080hsc')), $options);
    var_dump($ret);
    write_my_log('MoneyBravo', 'SellingValueAndFeeListForBravo ' . $date . '  varerror ' . $ret->error_code . ' ' . date('Y-m-d h:i:s'));
    $ret = $soapclient->call('PaidAdvanceForBravo', $params = array("TradingDate" => $date, 'AuthenUser' => 'ba.nd', 'AuthenPass' => md5('hsc080hsc')), $options);
    var_dump($ret);
    write_my_log('MoneyBravo', 'PaidAdvanceForBravo ' . $date . '  varerror ' . $ret->error_code . ' ' . date('Y-m-d h:i:s'));
    //echo 'xong';
}
exit;
示例#26
0
<?php

require_once 'SOAP/Client.php';
$soapclient = new SOAP_Client('http://10.10.20.116:8004/soapcliapi.php');
if ($argc < 3) {
    echo "Usage: virtClientCM_pvremove <host ip> <device>\n";
    echo "Example of usage: virtClientCM_pvremove 10.10.20.79 /dev/sdb1\n";
    exit(0);
}
$host = $argv[1];
$dev = $argv[2];
$params = array('host' => $host, 'dev' => $dev);
/* Send a request to the server, and store its response in $response: */
$method = 'cli_pvremove';
// echo($dev);
$response = $soapclient->call($method, $params, array('namespace' => 'urn:soapCliController'));
if (is_a($response, 'PEAR_Error')) {
    echo $soapclient->getLastRequest() . "\n";
    echo 'Error: ' . $response->getMessage() . "\n";
} else {
    $response = json_decode($response, true);
    if (!$response['success']) {
        echo $response['error'];
        echo "\n";
        exit(0);
    } else {
        print_r($response['response']);
    }
}
echo "\n";
	   cvs -d :pserver:cvsread@cvs.php.net:/repository login
	   (enter phpfi as the password)
	   cvs -d :pserver:cvsread@cvs.php.net:/repository co pear/SOAP

	   You will need a Google license key - see this site:
		  http://www.google.com/apis/

		  */
include "SOAP/Client.php";
// Google search query
$query = 'soap';
// Your google license key
$key = 'xxxxxxxxxxxxxxxxxxxxxxxxx';
$s = new SOAP_Client('http://api.google.com/search/beta2');
$result = $s->call('doGoogleSearch', array('key' => $key, 'q' => $q, 'start' => 0, 'maxResults' => 10, 'filter' => false, 'restrict' => '', 'safeSearch' => false, 'lr' => '', 'ie' => '', 'oe' => ''), 'urn:GoogleSearch');
// Is result a PEAR_Error?
if (get_class($result) == 'pear_error') {
    $message = $result->message;
    $output = "<p>An error occured: {$message}</p>";
} else {
    // We have proper search results
    $num = $result['estimatedTotalResultsCount'];
    $elements = $result['resultElements'];
    $list = '';
    if ($num > 0) {
        foreach ($elements as $item) {
            $size = $item['cachedSize'];
            $title = $item['title'];
            $url = $item['URL'];
            $snippet = $item['snippet'];