コード例 #1
0
 public function inspect($targetObject)
 {
     if (LOGGING) {
         Log::log(LoggingConstants::DEBUG, "WebServiceHandler.inspect, targetObject: " . $targetObject);
     }
     if (strripos($targetObject, "wsdl") != strlen($targetObject) - 4) {
         return null;
     }
     $proxyhost = '';
     $proxyport = '';
     $proxyusername = '';
     $proxypassword = '';
     $client = new soapclient($targetObject, true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
     $err = $client->getError();
     if ($err) {
         throw new Exception($err);
     }
     $proxy = $client->getProxy();
     //			$webInsp = new WebServiceInspector();
     //			$webInsp->inspect($targetObject);
     //
     //			$serviceDescriptor = $webInsp->serviceDescriptor;
     ////			if( LOGGING )
     ////				Log::log( LoggingConstants::MYDEBUG, ob_get_contents());
     //			$_SESSION['wsdl'][$targetObject] = serialize($serviceDescriptor);
     $proxyName = get_class($proxy);
     $proxyReflection = new ReflectionClass($proxyName);
     $serviceDescriptor = ClassInspector::inspectClass($proxyReflection);
     if (LOGGING) {
         Log::log(LoggingConstants::DEBUG, "web service handler has successfully inspected target service");
     }
     return $serviceDescriptor;
 }
コード例 #2
0
 public function PinPaymentEnquiry($authorityCode, $status)
 {
     // instantiate the SOAP client object
     $soap = new soapclient($this->wsdl, "wsdl");
     // get the SOAP proxy object, which allows you to call the methods directly
     $proxy = $soap->getProxy();
     // set parameter parameters (PinPaymentEnquiry^)
     $parameters = array(pin => $this->pin, authority => $authorityCode, status => $status);
     // get the result, a native PHP type, such as an array or string
     $result = $proxy->PinPaymentEnquiry($parameters);
     return $result;
 }
コード例 #3
0
 public function Connect()
 {
     // instantiate wsdl cache manager
     if ($this->mDbConfig['db_wsdl_cache_path'] != '' && $this->mDbConfig['db_wsdl_cache_enabled']) {
         $wsdl_cache = new wsdlcache($this->mDbConfig['db_wsdl_cache_path'], $this->mDbConfig['db_wsdl_cache_lifetime']);
     }
     // try to get from cache first...
     $wsdl_url = $this->mDbConfig['db_wsdl_url'];
     if ($this->mDbConfig['db_namespace']) {
         $wsdl_url_query = parse_url($wsdl_url, PHP_URL_QUERY);
         if (!$wsdl_url_query) {
             $wsdl_url .= '?nspace=' . $this->mDbConfig['db_namespace'];
         } else {
             $wsdl_url .= '&nspace=' . $this->mDbConfig['db_namespace'];
         }
     }
     if ($wsdl_cache) {
         $wsdl = $wsdl_cache->get($wsdl_url);
     }
     // cache hit? if not, get it from server and put to cache
     if (!$wsdl) {
         SysLog::Log('Cache MISSED: ' . $wsdl_url, 'SoapDatabaseEngine');
         $wsdl = new wsdl($wsdl_url, $this->mDbConfig['db_proxy_host'], $this->mDbConfig['db_proxy_port'], $this->mDbConfig['db_proxy_user'], $this->mDbConfig['db_proxy_pass'], $this->mDbConfig['db_connection_timeout'], $this->mDbConfig['db_response_timeout']);
         $this->mErrorMessage = $wsdl->getError();
         if ($this->mErrorMessage) {
             SysLog::Log('WSDL error: ' . $this->mErrorMessage, 'DatabaseEngine');
             $this->mErrorMessage = 'An error has occured when instantiating WSDL object (' . $this->mDbConfig['db_wsdl_url'] . '&nspace=' . $this->mDbConfig['db_namespace'] . '). The error was: "' . $this->mErrorMessage . '" Check your WSDL document or database configuration.';
             return FALSE;
         }
         if ($wsdl_cache) {
             $wsdl_cache->put($wsdl);
         }
     } else {
         SysLog::Log('Cache HIT: ' . $this->mDbConfig['db_wsdl_url'] . '&nspace=' . $this->mDbConfig['db_namespace'], 'SoapDatabaseEngine');
     }
     // use it as usual
     $temp = new soapclient($wsdl, TRUE, $this->mDbConfig['db_proxy_host'], $this->mDbConfig['db_proxy_port'], $this->mDbConfig['db_proxy_user'], $this->mDbConfig['db_proxy_pass'], $this->mDbConfig['db_connection_timeout'], $this->mDbConfig['db_response_timeout']);
     $this->mErrorMessage = $temp->getError();
     if (!$this->mErrorMessage) {
         $this->mrDbConnection = $temp->getProxy();
         if (isset($this->mDbConfig['db_credentials'])) {
             $this->mrDbConnection->setCredentials($this->mDbConfig['db_credentials']['user'], $this->mDbConfig['db_credentials']['pass'], $this->mDbConfig['db_credentials']['type'], $this->mDbConfig['db_credentials']['cert']);
         }
         return TRUE;
     } else {
         SysLog::Log('Error in SoapDatabaseEngine: ' . $temp->getError(), 'SoapDatabaseEngine');
         return FALSE;
     }
 }
コード例 #4
0
ファイル: WebServiceActions.php プロジェクト: ksecor/civicrm
/**
 * 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);
    }
}
コード例 #5
0
ファイル: clientMailmanLists.php プロジェクト: benzen/Ulysse
 *	Description: This class is the client of the web services for Mailman list
 *	Author: Maria Alejandra Trujillo Valencia
 *	E-Mail: alejandra.trujillo@atosorigin.com
 *	Creation date: 13-03-2009
 *	Last modification: 22-05-2009 by Maria Alejandra Trujillo Valencia
 *
*/
$type = $_GET["type"];
$list_id = $_GET["list_id"];
$archive_id = $_GET["archive_id"];
//** SE INCLUYE LA CLASE DE SOAP **//
require "nusoap-0.7.3/lib/nusoap.php";
//** SE CREA EL CLIENTE **//
$url_server = "http://ezwebdev.eurodyn.com/mailing-services/serverMailmanLists";
$cliente = new soapclient("" . $url_server . "?wsdl", "true");
$proxy = $cliente->getProxy();
//** LLAMA AL METODO QUE SE NECESITA **//
$uri = $_SERVER["REQUEST_URI"];
$list = explode("?", $uri);
$sizeList = sizeOf($list);
if ($sizeList > 1) {
    $resultado = $proxy->ListList((string) "lists/" . $list[1] . "/archives.json");
} else {
    $resultado = $proxy->ListList((string) "lists.json");
}
//** SE REVISAN ERRORES **//
if (!$cliente->getError()) {
    print_r($resultado);
} else {
    echo "<h1>Error: " . $cliente->getError() . "</h1>";
}
コード例 #6
0
ファイル: ePay.old.php プロジェクト: rezarahimi4861/icmf
 public function m_failTrans($batch_number)
 {
     if (!$_POST['sb24password']) {
         $this->watchDog->watch('4', $lang[securityError]);
         BRING_SB24PASSWORD($batch_number);
         die;
     }
     if (!($sql = mysql_query(" select * from epay where 1 and batch_number='" . $_POST['batch_number'] . "'"))) {
         ERROR("Error in mysql_query6");
         return false;
     }
     if (mysql_num_rows($sql) != 1) {
         ERROR("Invalid security:8");
         return false;
     }
     if (!($row = mysql_fetch_array($sql))) {
         ERROR("Error in mysql_query7");
         return false;
     }
     if ($row['pay_value'] <= 0) {
         ERROR("Invalid value");
         return false;
     }
     #	include('/usr/share/pear/nusoap.php');
     require_once 'nusoap/nusoap.php';
     $nusoap = new soapclient('https://acquirer.sb24.com/ref-payment/ws/ReferencePayment?WSDL', 'wsdl');
     $soapProxy = $nusoap->getProxy();
     $res = $soapProxy->ReverseTransaction($_POST['batch_number'], $GLOBALS['MID'], $_POST['sb24password'], $row['pay_value']);
     //reference number,sellerid,password,reverse amount
     return $res;
 }
コード例 #7
0
 function keywordSearch($search, $page, $mode = 'books')
 {
     if (METHOD == 'SOAP') {
         error_reporting(E_ALL & ~E_NOTICE);
         $soapclient = new soapclient('http://soap.amazon.com/schemas2/AmazonWebServices.wsdl', 'wsdl');
         $soap_proxy = $soapclient->getProxy();
         $parameters['mode'] = $mode;
         $parameters['page'] = $page;
         $parameters['type'] = "heavy";
         $parameters['tag'] = $this->assocID;
         $parameters['devtag'] = $this->devTag;
         $parameters['sort'] = '+salesrank';
         $parameters['keyword'] = $search;
         // perform actual soap request
         $result = $soap_proxy->KeywordSearchRequest($parameters);
         if (isSOAPError($result)) {
             return false;
         }
         foreach ($result['Details'] as $product) {
             $this->products[] = new Product($product);
         }
         $this->totalResults = $result['TotalResults'];
         unset($soapclient);
         unset($soap_proxy);
     } else {
         $this->type = 'search';
         $this->search = $search;
         $this->page = $page;
         $search = urlencode($search);
         $this->mode = $mode;
         $this->url = 'http://xml.amazon.com/onca/xml2?t=' . ASSOCIATEID . '&dev-t=' . DEVTAG . '&KeywordSearch=' . $search . '&mode=' . $this->mode . '&type=heavy&page=' . $this->page . '&sort=+salesrank&f=xml';
         $this->parseXML();
     }
     return $this->products;
 }