I am fairly new to XML-RPC stuff and I think I might be approaching it from an "unusual" angle! :-). Anyway, I have an API Server I need to interface with that expects to see input along the lines of

<?xml version="1.0"?> <methodCall> <methodName>Gateway.SendMessage</methodName> <params> <param> <value> <struct> <member> <name>Service</name> <value><int>0</int></value> </member> <member> <name>Password</name> <value>aPassword</value> </member> <member> <name>Text</name> <value>A demonstration short message</value> </member> <member> <name>DeliveryTime</name> <value><dateTime.iso8601>20050421T09:32:00</dateTime.iso8601>< +/value> </member> </struct> </value> </param> </params> </methodCall>

Now,

use RPC::XML::Client; my $client = RPC::XML::Client->new('http://path-to-rpc-server:19000'); my $res = $client->send_request('Gateway.SendMessage');

seems (I hope) clear enough, but I can't for the life of me understand how to get the Service,Password,Text etc parameters across.

Please, please can someone help?

Since I am coming across more and more API's written this way, it feels natural to take their expected XML input and translate it into what RPC::XML can work with. But I can't find any examples that display this sort of thinking. Am I really coming at this backwards?

Thanks

Bill


In reply to RPC::XML::Client example needed by zeltus

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.