PHP: xmlrpc_server_call_method - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

xmlrpc_server_create xmlrpc_server_add_introspection_data

Last updated: Fri, 26 Jan 2007

view this page in

# xmlrpc_server_call_method

(PHP 4 >= 4.1.0, PHP 5)

xmlrpc_server_call_method -- Parses XML requests and call methods

## Описание

string xmlrpc_server_call_method ( resource server, string xml, mixed user_data [, array output_options] )

Внимание
Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

Внимание
К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.

add a note User Contributed Notes
xmlrpc_server_call_method
marco.buratto at tiscali punto it
28-Dec-2006 08:15
`xmlrpc_server_call_method() with class methods
<?php
require_once ('Connections/adodb_mysql_connection.php');
// Instantiating my own class
$my_report = new external_report($db_connection);
// Setting up the XML-RPC "server"
$xmlrpc_server_handler = xmlrpc_server_create();
xmlrpc_server_register_method($xmlrpc_server_handler, "external_method", array(&$my_report, "export"));
// Creating XML return data
if ($response = xmlrpc_server_call_method($xmlrpc_server_handler, $HTTP_RAW_POST_DATA, null))
{
header('Content-Type: text/xml');
echo $response;
}
// **************** class definition ****************
class external_report
{
protected $db_connection;
public function __construct($db_connection_pointer)
{
if (method_exists($db_connection_pointer, "Execute")) $this->db_connection = $db_connection_pointer;
else die("...");
}
public function export($method_name, $params_array)
{
$id_dir = (int)$params_array[0];
$id_usr = (int)$params_array[1]; // not used, just an example
// We have to add arguments' validating code here and NOT inside the constructor (as usual)
// because arguments are passed directly by xmlrpc_server_call_method (?!!)
$myexport = array();
$dirs_query = "SELECT documento_id FROM tabella_cartelle WHERE cartella_id = ".$id_dir;
$dirs_result = $this->db_connection->Execute($dirs_query) or die("...");
$index = 0;
while(!$dirs_result->EOF)
{
$docs_query = "SELECT codice, titolo FROM tabella_documenti WHERE id_documento = ".$dirs_result->Fields('documento_id');
$docs_result = $this->db_connection->Execute($docs_query) or die("...");
$myexport[$index]['codice'] = $docs_result->Fields('codice');
$myexport[$index]['titolo'] = $docs_result->Fields('titolo');
$index++;
$dirs_result->MoveNext();
}
return $myexport;
}
}
?>`
nyvsld at gmail dot com
27-Nov-2005 05:08
`<?php
/* method implementation */
function impl($method_name,$params,$user_data){
var_dump(func_get_args('impl'));
return array_sum($params);
}
/* create server */
$s=xmlrpc_server_create();
xmlrpc_server_register_method($s,'add','impl');
/* calling server method */
$req=xmlrpc_encode_request('add',array(1,2,3));
$resp=xmlrpc_server_call_method($s,$req,array(3,4));
/* process result */
$decoded=xmlrpc_decode($resp);
if(xmlrpc_is_fault($decoded)){
echo 'fault!';
}
var_dump($decoded);
?>`
zionglau at yahoo dot com
20-Jul-2004 10:44
`here is a document about output options
http://xmlrpc-epi.sourceforge.net/main.php?t=php_api#output_options`
add a note
xmlrpc_server_create xmlrpc_server_add_introspection_data

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST