Re: RPC::XML perl module, valid values for signature?
Ted Pedersen <[email protected]> Tue, 22 Mar 2011 09:11:23 -0500
| Newsgroups | gmane.text.xml.rpc.specification |
|---|---|
| Message-ID | <[email protected]> |
To answer my own query just a bit, here's a tutorial that's somewhat
helpful, although it doesn't get into the signature issue much ...
http://www.herongyang.com/perl_b/rpc_xml.html
From the book "Web Services Programming with Perl" (page 312), I've found
that the valid data classes for RPC::XML are ...
int, i4, double, string, boolean, datetime_iso8601, base64, array, struct,
fault
So is it fair/safe to assume that these are the values that may be in the
signature field/list, as in...
->add_proc({ name => 'fortune',
signature => [ 'array',
'array string',
'array array' ],
code => \&XRFortune::fortune })
And so a signature like
[struct, int, int]
means that the method/procedure returns a struct, and expects 2 integers as
input??
Thanks for any guidance that can be offered, especially if the above is
wrong or misses some important point.
Cordially,
Ted
On Sun, Mar 20, 2011 at 8:56 PM, ted_pedersen <[email protected]> wrote:
>
>
> Greetings all,
>
> Can anyone shed light on how signatures should be used in RPC::XML::Server?
>
>
> The documentation is fairly vague...
>
> =====
>
> http://search.cpan.org/~rjray/RPC-XML-0.74/lib/RPC/XML/Server.pm#Methods
>
> signature
>
> A list reference of the signatures by which this routine may be invoked.
> Every method has at least one signature. Though less efficient for cases of
> exactly one signature, a list reference is always used for sake of
> consistency.
>
> =====
>
> What are the valid values for the signature field, and what do they
> represent?
>
> Below is an example where you can see the signature field in action... what
> you see are the fields include things like "array", "array string", "array
> array"...Is there a finite set of values for these fields, and if so, what
> are they?
>
> # This is an example program from Programming Web Services with Perl,
> # by Randy Ray and Pavel Kulchenko
>
> use strict;
> use warnings;
>
> use XRFortune;
> use RPC::XML::Server;
>
> # The object created by the constructor will be used to
> # chain on a set of calls to add_proc() (which means it
> # isn't necessary to deal with the local routines being
> # called as methods), and then drop directly into the
> # server_loop() method.
>
> RPC::XML::Server->new(port => 31135)
> # add_proc can take a pre-created RPC::XML::Procedure
> # object, or a hash reference.
> # It gets called once for each routine being made
> # public by the server.
> ->add_proc({ name => 'fortune',
> signature => [ 'array',
> 'array string',
> 'array array' ],
> code => \&XRFortune::fortune })
>
> # This method will only return after a signal interrupts
> # it.
> ->server_loop;
>
> exit;
>
> Thanks!
> Ted
>
>
>
--
Ted Pedersen
http://www.d.umn.edu/~tpederse
[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/