perl RPC::XML (blackperl)

"zeltus" <[email protected]> Fri, 23 Mar 2012 12:11:47 -0000
Newsgroups gmane.text.xml.rpc.specification
Message-ID <[email protected]>
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 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 anyone 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?

What is the Group's opinion on this? That is, how should I approach the task of connecting to API's such as this? 

Once I am up and running on this, I intend to set up my own XML-RPC server for testing and upskilling myself. I think I will be wanting some help then!

Thanks

Bill



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/