| 
	
 | 
 Posted by xhe on 10/01/07 14:38 
Hi, 
 
I am trying to use xmlrpc to set up a client/server connection. I used 
PHP5 in Apache2, with xmlrpc.inc downloaded from http://phpxmlrpc.sourceforge.net/, 
which is created by Edd Dumbill. 
 
Client side is: 
 
<?php 
  require_once('xmlrpc.inc'); 
  $c = new xmlrpc_client("http://localhost:84/server.php"); 
  $c->setDebug(1); 
  $m = new xmlrpcmsg('fns_test', array(new xmlrpcval(20, "int"))); 
  $r = $c->send($m); 
  echo $r->serialize(); 
 ?> 
 
Server side is: 
<?php 
    include("xmlrpc.inc"); 
    include("xmlrpcs.inc"); 
 
    $findstate_sig=array(array($xmlrpcString,$xmlrpcInt)); 
    $findstate_doc="find state name based on name"; 
    $s=new xmlrpc_server( 
        array( 
            "fns_test" => array( 
                "function" => "findstate1", 
                "signature"=>$findstate_sig, 
                "docstring"=>$findstate_doc 
            ) 
        ) 
    ); 
    $s->setDebug(2); 
    function  findstate1($m) 
    { 
        $sname="WashingTon";  return $sname; 
    //    return new xmlrpcresp(new xmlrpcval($sname)); 
    } 
?> 
 
I have already simplified the code to the minimum, but when I run the 
client, I always got following error: 
 
faultCode 105 faultString XML error: Invalid document end at line 1, 
column 1 
 
I googled a lot, but no relevant result. Does anyone have this 
relevant error when setting up server side? From the fault string, 
this might be the xml format error, but I only use the xmlrpc client 
to send request, no other string sent by myself.. 
 
Thanks anybody for reading this thread and your help is appreciated. 
 
Frank
 
[Back to original message] 
 |