CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
error while executing XML RPC functions

 



chandarvr
New User

Apr 14, 2011, 6:50 AM

Post #1 of 1 (4170 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]



Code
#!/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]


Code
#!/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




Code
---- 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...

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives