
chandarvr
New User
Apr 14, 2011, 6:50 AM
Post #1 of 1
(3880 views)
|
error while executing XML RPC functions
|
Can't Post
|
|
Hi All I have written a rpc call using frontier::client module and the server with frontier::deamon. Below is the client code snippet [xmlrpc.pl]
#!/opt/perl/bin/perl use Frontier::Client; # Make an object to represent the XML-RPC server. $server_url = "https://ipaddress/cgi-bin/testrpc.pl"; $server = Frontier::Client->new('url' => $server_url,'debug' => 1,'username' => 'user','password' => pass','encod ing' => 'ISO-8859-1'); @args = (2,5); $sumval = $server->call('sum'), "\n"; Below is the server code snippet [testrpc.pl]
#!/usr/bin/perl print "Content-type: text/html \n\n"; use Frontier::Daemon; sub sum{ return 2; } # Call me as http://localhost:8080/RPC2 my $d=Frontier::Daemon->new( methods => {sum => \&sum},LocalPort => 443,LocalAddr => localip); But when i execute xmlrpc.pl i am getting the follwing error in the response
---- request ---- <?xml version="1.0" encoding="ISO-8859-1"?> <methodCall> <methodName>sum</methodName> <params> </params> </methodCall> ---- response ---- no element found at line 1, column 0, byte -1 at /opt/perl/lib/site_perl/5.8.0/sun4-solaris/XML/Parser.pm line 187 Please help me on this...
|