Hi all, I am trying to use RPC::XML to send request to a server and get back the result as response. But i get the following error when executing a small addition program. I have already installed perl web server in port:80. My program is as follows:
#!/usr/bin/perl # Testing sum() use strict; use warnings; use RPC::XML::Client; sub sum { my ($args1,$args2) = @_; print "inside sum"; return $args1 + $args2; } my @args = (9,9); print "The numbers to be added are :@args\n"; my $client = new RPC::XML::Client 'http://lovalhost:80'; my $req = RPC::XML::request->new('sum', @args); my $res = $client->send_request($req); print "The result is : $res";
I get the following error as result.
The numbers to be added are :9 9 The result is : syntax error at line 1, column 54, byte 54: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> =====================================================^ <HTML> at C:/Perl/site/lib/RPC/XML/Client.pm line 394
As i am newbie in perl i am not able to figure out the reason for the error.Please help me out in rectifying this one. The main aim is to integrate perl and JAVA.That is the reason i am in need of RPC::XML.... Thanks in advance, Aishu

In reply to RPC::XML error by Aishu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.