Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-23 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found