Ejemplo n.º 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;
}
Ejemplo n.º 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);
    }
}
Ejemplo n.º 3
0
 function CDAB()
 {
     $this->url = DAB_WEBSERVICE_URL;
     $soapClient = new SOAP_Client($this->url, true, false, array(), "/tmp/pear/cache");
     $soapClient->setOpt("timeout", 100);
     //$soapClient->setOpt('curl', CURLOPT_VERBOSE, 0);
     $soapClient->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);
     $soapClient->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
     $soapClient->setOpt('curl', CURLOPT_CAPATH, '/usr/local/ssl/certs');
     $this->soapOptions = array('namespace' => 'http://controller.com.eab', 'trace' => 1);
     $secretkey = "5wMr N5lFU?|!b)R^jZN,lebw~xVPz9+XG\"NHB?N";
     $this->hasher =& new Crypt_HMAC($secretkey, "sha1");
     $this->soapClient = $soapClient;
     $this->accessKey = "JnShns06ip2cQ6S2vxKZ";
 }
Ejemplo n.º 4
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);
}
Ejemplo n.º 5
0
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
**/
/*
 * 	USAGE : http://localhost/webservice/SOAP/test-callbackexec.php
 */
include '../lib/admin.defines.php';
require 'SOAP/Client.php';
$security_key = API_SECURITY_KEY;
$endpoint = 'http://localhost/~areski/svn/asterisk2billing/trunk/webservice/SOAP/soap-a2billing-server.php';
// Create SOAP Client
$callback = new SOAP_Client($endpoint);
echo "<hr>#############   GET COUNTRIES   ############# <br/><hr/> <pre>";
$method = 'Get_Countries';
$params = array('security_key' => md5($security_key));
$ans = $callback->call($method, $params);
print_r(unserialize($ans[0]));
exit;
echo "<hr>#############   Get ProvisioningList   ############# <br/><hr/> <pre>";
$method = 'Get_ProvisioningList';
$params = array('security_key' => md5($security_key), 'provisioning_uri' => "http://www.call-labs.com/provisioning.txt");
$ans = $callback->call($method, $params);
print_r(unserialize($ans[0]));
echo "<hr>#############   GET LANGUAGE   ############# <br/><hr/> <pre>";
$method = 'Get_Languages';
$params = array('security_key' => md5($security_key));
$ans = $callback->call($method, $params);
Ejemplo n.º 6
0
 /**
  * Override some of the default SOAP:: package _decode behavior to
  * handle simpleTypes and complexTypes with simpleContent.
  */
 function &_decode(&$soapval)
 {
     if (count($soapval->attributes)) {
         $attributes = $soapval->attributes;
     }
     $object =& PayPal::getType($soapval->type);
     if (PayPal::isError($object)) {
         return parent::_decode($soapval);
     }
     $this->_type_translation[$soapval->type] = $soapval->type;
     $result =& parent::_decode($soapval);
     if (!is_a($result, 'XSDType') && is_a($object, 'XSDSimpleType')) {
         $object->setval($result);
         if (isset($attributes)) {
             foreach ($attributes as $aname => $attribute) {
                 $object->setattr($aname, $attribute);
             }
         }
         $result =& $object;
     }
     return $result;
 }
Ejemplo n.º 7
0
 public function __construct($endpoint, $wsdl = false, $portName = false, $proxy_params = array())
 {
     parent::SOAP_Client($endpoint, $wsdl, $portName, $proxy_params);
 }
Ejemplo n.º 8
0
 * 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
 */
/** SOAP_Client */
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://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();
Ejemplo n.º 9
0
// | 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: 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";
Ejemplo n.º 10
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;
 }
Ejemplo n.º 11
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;
}
Ejemplo n.º 12
0
 /**
  * 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;
     }
 }
 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);
 }
Ejemplo n.º 14
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";
Ejemplo n.º 15
0
print_r($ret);
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', 
Ejemplo n.º 16
0
<?php

$c = new SOAP_Client('http://localhost/example.wsdl');
$ret = $c->echoStruct(new SOAPStruct())->deserializeBody();
var_dump($ret);
Ejemplo n.º 17
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);
Ejemplo n.º 18
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);
Ejemplo n.º 19
0
$status = 1;
$simultaccess = 1;
$currency = 'EUR';
$typepaid = 1;
$sip_buddy = $iax_buddy = 1;
$language = 'en';
$voicemail_enabled = 1;
$country = 'USA';

// #Account
$units = 10000;



// Create SOAP Client
$callback = new SOAP_Client($endpoint);
$callback -> setOpt("timeout", 0);

echo "<hr>#############   Create Account  ############# <br/><hr>";
$method = 'Create_Customer';
$time_start = microtime(true);
$params = array('security_key' => md5($security_key), 
                'instance' => $instance,
                'id_callplan' => $id_callplan,
                'id_didgroup' => $id_didgroup,
                'units' => $units,
                'accountnumber_len' => $accountnumber_len,
                'balance' => $balance,
                'activated' => $activated,
                'status' => $status,
                'simultaccess' => $simultaccess,
Ejemplo n.º 20
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>
Ejemplo n.º 21
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;
?>

Ejemplo n.º 22
0
		</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="submit" value="Send" />
			<input type="button" value="Back" onclick="javascript: window.location='index.php'"/>
		</td>
	</tr>
</table>
		</form>

	<?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':
Ejemplo n.º 23
0
 function client(&$data)
 {
     $attachments = array();
     /* If neither matches, we'll just try it anyway. */
     if (stristr($data, 'Content-Type: application/dime')) {
         $this->_decodeDIMEMessage($data, $this->headers, $attachments);
         $useEncoding = 'DIME';
     } elseif (stristr($data, 'MIME-Version:')) {
         /* This is a mime message, let's decode it. */
         $this->_decodeMimeMessage($data, $this->headers, $attachments);
         $useEncoding = 'Mime';
     } else {
         /* The old fallback, but decodeMimeMessage handles things fine. */
         $this->_parseEmail($data);
     }
     /* Get the character encoding of the incoming request treat incoming
      * data as UTF-8 if no encoding set. */
     if (!$this->soapfault && !$this->_getContentEncoding($this->headers['content-type'])) {
         $this->xml_encoding = SOAP_DEFAULT_ENCODING;
         /* An encoding we don't understand, return a fault. */
         $this->_raiseSoapFault('Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8', '', '', 'Server');
     }
     if ($this->soapfault) {
         return $this->soapfault->getFault();
     }
     $client = new SOAP_Client(null);
     return $client->__parse($data, $this->xml_encoding, $this->attachments);
 }
Ejemplo n.º 24
0
// +----------------------------------------------------------------------+
// | 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 Hanna <iordy_at_iordy_dot_com>                        |
// +----------------------------------------------------------------------+
//
// $Id: tcp_client.php,v 1.3 2005/03/10 23:16:40 yunosh Exp $
//
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' => 1);
# one
$params = array("string" => "this is string 1");
$ret1 = $soapclient->call("echoString", $params, $options);
# echo "WIRE: \n".$soapclient->__get_wire();
print_r($ret1);
echo "<br />\n";
# two
$params = array("string" => "this is string 2");
$ret2 = $soapclient->call("echoString", $params, $options);
# echo "WIRE: \n".$soapclient->__get_wire();
print_r($ret2);
echo "<br />\n";
Ejemplo n.º 25
0
// | 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: client.php,v 1.1 2005/08/15 16:29:31 colson Exp $
//
require_once '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://cclite.caca-cola.com:83/cgi-bin/ccserver.cgi");
//$soapclient = new SOAP_Client(null, array('location' => "http://cclite.caca-cola.com:83/cgi-bin/ccserver.cgi",
//                                     'uri'      => "http://cclite.caca-cola.com:83/Cclite"));
// this namespace is the same as declared in server.php
$options = array('namespace' => 'urn:Cclite', 'trace' => 5);
$token = 'test';
$transaction = array();
// convert to standard transaction input format, fields etc.
// fromregistry : chelsea
$transaction['fromregistry'] = 'chelsea';
// home : http://cclite.caca-cola.com:83/cgi-bin/cclite.cgi, for example
$transaction['home'] = "";
# no home, not a web transaction
// subaction : om_trades
$transaction['subaction'] = 'om_trades';
// toregistry : dalston
Ejemplo n.º 26
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);
Ejemplo n.º 27
0
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;
Ejemplo n.º 28
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>
Ejemplo n.º 29
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";
Ejemplo n.º 30
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;