本文整理汇总了PHP中Zend_XmlRpc_Client::getProxy方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Client::getProxy方法的具体用法?PHP Zend_XmlRpc_Client::getProxy怎么用?PHP Zend_XmlRpc_Client::getProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_XmlRpc_Client
的用法示例。
在下文中一共展示了Zend_XmlRpc_Client::getProxy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xmlrpcgetuserlistAction
/**
* XMLRPC user list
*/
public function xmlrpcgetuserlistAction()
{
$client = new Zend_XmlRpc_Client('http://front.zend.local/Wsserver/index/xmlrpc');
$systemService = $client->getProxy('system');
$userService = $client->getProxy('user');
$string = $userService->testString();
var_dump( $string );
$object = $userService->testObject();
var_dump( $object );
$array = $userService->testArray();
var_dump( $array );
$array = $userService->testArray2();
var_dump( $array );
$arrayOfOjects = $userService->listUsers();
var_dump( $arrayOfOjects );
$methods = $systemService->listMethods();
print_r( $methods );
$help = $systemService->methodSignature( 'user.authenticate' );
print_r( $help );
exit;
}
示例2: deleteTicket
public function deleteTicket($id)
{
$proxy = $this->_client->getProxy('ticket');
// int ticket.delete(int id)
$result = $proxy->delete($id);
return $result === 0;
}
示例3: testServerProxyCachesNestedProxies
public function testServerProxyCachesNestedProxies()
{
$proxy = $this->xmlrpcClient->getProxy();
$foo = $proxy->foo;
$this->assertSame($foo, $proxy->foo);
$bar = $proxy->foo->bar;
$this->assertSame($bar, $proxy->foo->bar);
}
示例4: xmlrpcConsoleAction
public function xmlrpcConsoleAction()
{
$serverUrl = str_replace('console', 'server', MAIN_URL . $this->getRequest()->getRequestUri());
$client = new Zend_XmlRpc_Client($serverUrl);
$example = $client->getProxy('example');
echo $example->getTime();
exit;
}
示例5: __construct
/**
* Create a new connection to a R1soft server.
*
* @param string $host Hostname or IP address of the R1soft server.
* @param string $username
* @param string $password
* @param bool $secure Use HTTPS
*/
public function __construct( $host, $username, $password, $secure = true ) {
if( $secure ) {
$this->_fullUrl = sprintf( 'https://%s:%s@%s:%d/xmlrpc', $username,
$password, $host, self::PORT_SECURE );
$this->_client = new Zend_XmlRpc_Client( $this->_fullUrl,
new Zend_Http_Client( null, array(
'ssltransport' => 'sslv3', //ssl does not properly detect v3
) ) );
} else {
$this->_fullUrl = sprintf( 'http://%s:%s@%s:%s/xmlrpc', $username,
$password, $host, self::PORT_UNSECURE );
$this->_client = new Zend_XmlRpc_Client( $this->_fullUrl );
}
$this->_proxy = $this->_client->getProxy();
$this->_testConnection();
}
示例6: get_xmlrpc
/**
* This returns a Zend_XmlRpc_Client instance - unless we can't log you in...
*/
function get_xmlrpc()
{
global $CONF;
require_once 'Zend/XmlRpc/Client.php';
$client = new Zend_XmlRpc_Client($CONF['xmlrpc_url']);
$http_client = $client->getHttpClient();
$http_client->setCookieJar();
$login_object = $client->getProxy('login');
if (empty($_SESSION['password'])) {
if (empty($_POST['password'])) {
_display_password_form();
exit(0);
} else {
try {
$success = $login_object->login($_SESSION['username'], $_POST['password']);
} catch (Exception $e) {
//var_dump($client->getHttpClient()->getLastResponse()->getBody());
error_log("Failed to login to xmlrpc instance - " . $e->getMessage());
die('Failed to login to xmlrpc instance');
}
if ($success) {
$_SESSION['password'] = $_POST['password'];
// reload the current page as a GET request.
header("Location: {$_SERVER['REQUEST_URI']}");
exit(0);
} else {
_display_password_form();
exit(0);
}
}
} else {
$success = $login_object->login($_SESSION['username'], $_SESSION['password']);
}
if (!$success) {
unset($_SESSION['password']);
die("Invalid details cached... refresh this page and re-enter your mailbox password");
}
return $client;
}
示例7: post
public static function post($message)
{
// получаем конфиг из application.ini
try {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', 'lj');
} catch (Exception $e) {
throw new Exception('Config load error. Check your application.ini. ' . $e);
}
// создаем новый объект класса Zend_XmlRpc_Client и передаем ему адрес сервера
$client = new Zend_XmlRpc_Client('http://www.livejournal.com/interface/xmlrpc');
// получаем объект прокси, при этом передаем ему пространство имен
$proxy = $client->getProxy('LJ.XMLRPC');
try {
//получаем challenge для авторизации
$challenge = $proxy->getchallenge();
} catch (Exception $e) {
throw new Exception('Connection fail. Get challenge fail. ' . $e);
}
$data = array('username' => $config->username, 'auth_method' => $config->auth_method, 'auth_challenge' => $challenge['challenge'], 'auth_response' => md5($challenge['challenge'] . md5($config->password)), 'ver' => $config->protocol_version, 'lineendings' => $config->lineendings, 'subject' => $message['title'], 'event' => $message['text'], 'day' => date('d'), 'mon' => date('m'), 'year' => date('Y'), 'hour' => date('H'), 'min' => date('i'), 'security' => 'public', 'props' => array('opt_preformatted' => true, 'opt_backdated' => true, 'taglist' => $message['tags']), 'usejournal' => $config->community);
//отправляем данные на сервер
try {
$p_data = $proxy->postevent($data);
} catch (Exception $e) {
throw new Exception('Post failed. ' . $e);
}
/*
если все нормально, то сервер вернет структуру с 3-мя переменными:
itemid - идентификатор поста
url - URL-адрес поста
anum - аутентификационный номер, созданный для этой записи
*/
if (empty($p_data)) {
echo 'Livejournal connection failed.';
return $p_data;
} else {
return $p_data;
}
}
示例8: __construct
/**
* @param Zend_XmlRpc_Client $client
*/
public function __construct(Zend_XmlRpc_Client $client)
{
$this->_system = $client->getProxy('system');
}
示例9: getProxy
public function getProxy($namespace = '')
{
if (empty($this->_proxyCache[$namespace])) {
$this->_proxyCache[$namespace] = new Python_SimpleXMLRPCServerWithUnsupportedIntrospection($this, $namespace);
}
return parent::getProxy($namespace);
}
示例10: xmlrpcConsoleAction
public function xmlrpcConsoleAction()
{
$client = new Zend_XmlRpc_Client(MAIN_URL . '/example/service/rpc-server');
$member = $client->getProxy('member');
}
示例11:
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Demos
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_XmlRpc_Client
*/
require_once 'Zend/XmlRpc/Client.php';
$server = new Zend_XmlRpc_Client('http://www.upcdatabase.com/rpc');
$client = $server->getProxy();
print_r($client->lookupUPC('071641301627'));
示例12: __construct
/**
* @param Zend_XmlRpc_Client $client
*/
public function __construct($client)
{
$this->_system = $client->getProxy('system');
}
示例13: ping
/**
* Pingback from Wikidot page (source URI) to external page (target URI)
*
* @throws PingBackException if pinging is not successfull
* @throws PingBackNotAvailableException when the target is not PingBack enabled
* @return string the endpoint return value
*/
public function ping()
{
try {
$rpc = new Zend_XmlRpc_Client($this->getExternalPingBackURI());
$srv = $rpc->getProxy('pingback');
return $srv->ping($this->wikidotURI, $this->externalURI);
} catch (Zend_Http_Client_Adapter_Exception $e) {
throw new PingBackException("HTTP Error: " . $e->getMessage());
} catch (Zend_Http_Client_Exception $e) {
throw new PingBackException("HTTP Error: " . $e->getMessage());
} catch (Zend_XmlRpc_Client_FaultException $e) {
throw new PingBackException("XMLRCP Error: " . $e->getMessage(), $e->getCode());
} catch (PingBackException $e) {
throw new PingBackException("Pingback Error: " . $e->getMessage());
} catch (Exception $e) {
throw new PingBackException("Unknown Error: " . $e->getMessage());
}
}
示例14: messageInput
/**
* Обработать сообщение и выдать результат анализа.
*
* @param ISF_Message $message сообщение
* @param string $domain поддомен, относительно которого обрабатывать сообщение
* @return string результат анализа
*/
public function messageInput(ISF_Message $message, $domain = null)
{
$params = array('partner' => $this->getPartnerAuth(), 'message' => $message->serialize());
if ($domain !== null) {
$params['domain'] = (string) $domain;
}
try {
$result = $this->api_transport->getProxy()->sf->message->input($params);
return $result['result'];
} catch (Zend_XmlRpc_Client_FaultException $e) {
throw new SF_API_Error($e->getMessage(), $e->getCode());
}
}
示例15:
<?php
$p = (double) $_POST['p'];
$i = $_POST['i'];
$n = (int) $_POST['n'];
$t = $_POST['t'];
$a = (int) $_POST['a'];
$i = (double) str_replace(',', '.', $i);
require 'startzend.php';
$client = new Zend_XmlRpc_Client('http://localhost/xmlgenerator/remote3.php');
$proxy = $client->getProxy('calculadora');
$m = $proxy->calculaMontante($p, $i, $n, $a);
$l = $m - $p;
//formatação
$l = str_replace('.', ',', $l);
$p = str_replace('.', ',', $p);
$i = str_replace('.', ',', $i * 100);
$m = str_replace('.', ',', $m);
$mensagem = "Um capital de R\$ {$p}, aplicado a uma taxa de juros de {$i}%, durante {$n} {$t} renderá R\$ {$l}";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<?php
echo $mensagem;
?>