[phpxmlrpc] return an array

didier.geheniau at feas.net didier.geheniau at feas.net
Fri Dec 5 00:27:46 CET 2008


Hi all,


I have the following simple code:

<?
include ("lib/xmlrpc.inc");
include ("lib/xmlrpcs.inc");
include ("lib/xmlrpc_wrappers.inc");

$userInfo = new xmlrpcval ( array(
		"dgeheniau", new xmlrpcval (
			array(
				"lastname", new xmlrpcval ("Geheniau",
"string"),
				"firstname", new xmlrpcval ("Didier",
"string"),
				"email", new xmlrpcval ("email at address.com",
"string")
			),
			"struct")
	), "struct");

$getUserInfo_sig = array(array($xmlrpcStruct, $xmlrpcString));
$getUserInfo_doc = "This function will return all know user info!";

function getUserInfo ($userName){
	global $userInfo;
	return new xmlrpcresp(new
xmlrpcval($userInfo->structmem("$userName"), "struct"));

}

#$o=new xmlrpc_server_methods_container;
$a=array(
	"user.getUserInfo" => array(
		"function" => "getUserInfo",
		"signature" => $getUserInfo_sig,
		"docstring" => $getUserInfo_doc
	)
);

$s=new xmlrpc_server($a, false);
$s->setdebug(3);
$s->compress_response = true;
$s->service();
?>

In the client I get:

+++PROCESSING ERRORS AND WARNINGS+++
Object of class xmlrpcmsg could not be converted to string
Undefined index:  
+++END+++

What am I doing wrong?

Regards,

Didier



More information about the phpxmlrpc mailing list