Re: perl RPC::XML (blackperl)
Bill Parker <[email protected]> Fri, 23 Mar 2012 16:03:07 +0000
| Newsgroups | gmane.text.xml.rpc.specification |
|---|---|
| Message-ID | <CALxYCQqUOc5UxjtbDtKdqetn__q6TpQTTsn1qvLswNwcPnv3eQ@mail.gmail.com> |
On 23 March 2012 15:29, Bryan Henderson <[email protected]> wrote: > ** > > > >Am I really coming at this backwards? > > I don't know if it's you, but somebody is coming at this backwards. You > don't > specfify an XML-RPC API with an XML document and have users reverse > engineer > it. The API in question should be documented something like this: > > Method name: "Gateway.SendMessage" > One parameter, of type structure. Members: > > Service: type integer, meaning: ... example: 0 > Password: type string, meaning: ... example: "aPassword" > Text: type string, meaning: ... example: "A demonstration short message" > DeliveryTime: type datetime, meaning: ... example: April 21, 2005 ... > > I don't fancy my chances of surviving telling our oh so sociable developers this! :-} But thank you so much for explaining this to me... what you are saying makes much more sense than what they try and brush me off with. > > Anyway, the way you specify RPC parameters is to add each as an argument to > your $client->send_request(). You need one parameter, so your > $client->send_request will have two arguments. That one parameter is a > structure, which is represented in XML::RPC by a XML::RPC::struct. The > constructor for XML::RPC::struct (see perldoc XML:RPC) takes a Perl hash > reference as its argument. Since a Perl hash and an XML-RPC structure are > virtually identical data structures, it's easy to see the correspondence, > with > the one complication that the hash values are references to XML::RPC data > objects, not the normal Perl data structures. The Perl hash you start with > is > thus something like > > ('Service' => new RPC::XML::int(0), > 'Password' => new RPC::XML::string('aPassword'), > 'Text' => new RPC::XML::string('A demonstration short message'), > ...) > > Lovely. Just the info I needed. Thank you This'll keep me busy until I decide I want to set up my own RPC-XML server to play with! Bill > > [Non-text portions of this message have been removed] ------------------------------------ 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/