<html>
<body>
After the changes, I keep on getting this (and I am beginning to get
insane!):<br>
<b>Fatal error</b>: Cannot redeclare xmlrpc_decode() in
/<b>.../xmlrpc.inc</b> on line <b>1380<br><br>
</b>Sam<br><br>
At 14.52 17/12/03, you wrote:<br>
<blockquote type=cite class=cite cite>Hi Sam,<br><br>
You should not need to do the xmlrpc_encode, and you need to<br>
pass in an array of parameters instead of a scalar value;<br>
try it like this:<br><br>
> $par1=new xmlrpcval(array(<br>
> "first_param" => new xmlrpcval("first_value",
"string"),<br>
> "second_param" => new
xmlrpcval("second_value", "string")),
"struct");<br>
> $f=new xmlrpcmsg("method",array($par1));<br>
> $r=$client->send($f);<br><br>
You should also use the defined XML-RPC constants for the data types.
Here<br>
is how I would write this code:<br><br>
$client = new xmlrpc_client("path", "server",
80);<br>
$p1 = new xmlrpc_val("first_value", $xmlrpcString);<br>
$p2 = new xmlrpc_val("second_value", $xmlrpcString);<br>
$par1 = new xmlrpc_val(array("first_param" => $p1,
"second_param" => $p2), $xmlrpcStruct);<br>
$f=new xmlrpcmsg("method", array($par));<br>
$r=$client->send($f);<br><br>
This should work, but I don't have access to your server so I<br>
can't say for sure.<br><br>
Turning on client debugging can be helpful too. After<br>
you create the client (first line above), try this:<br><br>
$client->setDebug(1);<br><br>
You can find a very comprehensive XML-RPC client at<br>
<a href="http://groups.yahoo.com/group/syndic8-dev/files/XML-RPC%20Test%20Program/" eudora="autourl">http://groups.yahoo.com/group/syndic8-dev/files/XML-RPC%20Test%20Program/</a><br><br>
This client calls the Syndic8 XML-RPC functions, as described at<br>
<a href="http://www.syndic8.com/services.php" eudora="autourl">http://www.syndic8.com/services.php</a>
.<br><br>
Hope this helps!<br><br>
Jeff;<br><br>
> $par1=new xmlrpcval(array(<br>
> "first_param" => new xmlrpcval("first_value", "string"),<br>
> "second_param" => new xmlrpcval("second_value", "string")), "struct");<br>
> $par=xmlrpc_encode($par1);<br>
> $f=new xmlrpcmsg("method",$par);<br>
> $r=$client->send($f);<br><br>
<br>
<blockquote type=cite class=cite cite>Hi everybody,<br>
I am new to phpxmlrpc. I downloaded the xmlrpc class and tried to use it.<br>
After lots of tries, I keep on getting this error:<br>
*Fatal error*: Cannot redeclare xmlrpc_decode() in */.../xmlrpc.inc* on line *1380<br>
*I can get out of this, can anyone help me?<br>
I am working with a very simple script like this:<br>
$client=new xmlrpc_client("path", "server", 80);<br>
$par1=new xmlrpcval(array(<br>
"first_param" => new xmlrpcval("first_value", "string"),<br>
"second_param" => new xmlrpcval("second_value", "string")), "struct");<br>
$par=xmlrpc_encode($par1);<br>
$f=new xmlrpcmsg("method",$par);<br>
$r=$client->send($f);<br>
Thank you in advance<br>
Sam</blockquote></blockquote></body>
</html>