Loading ...
Sorry, an error occurred while loading the content.

1074Re: [soaplite] XMLRPC::Lite and checking for a returned array

Expand Messages
  • Paul Kulchenko
    Dec 5, 2001
    • 0 Attachment
      Hi, Emmanuel!

      > I'm learning XMLRPC::Lite but I can't find a way to access a
      > returned array from the server.
      From my understanding XML-RPC spec [1] allows you to return only one
      value, so when you do

      return (1,2,3);

      client side will have access only to value '1'.

      If you need to return an array, you can do

      return [1,2,3];

      and on client side you'll get array ref;

      $res = ...->result;
      print @$res;

      Hope it helps. Let me know if you think my understanding of XML-RPC
      spec is wrong.

      Best wishes, Paul.

      [1] http://xml-rpc.com/spec

      --- magnus1er <magnus1er@...> wrote:
      > Hello,
      >
      > A very basic question but I can't find an answer (on the web at
      > least).
      >
      > I'm learning XMLRPC::Lite but I can't find a way to access a
      > returned
      > array
      > from the server.
      >
      > For example the following is returned by the xmlrpc server:
      >
      > <?xml version="1.0"
      > encoding="UTF-8"?><methodResponse><params><param><value><string>
      > Salut mon gros
      > </string></value></param><param><value><string>Ceci est un test
      > </string></value></param><param><value><string>Mais il manque des
      > points
      > </string></value></param><param><value><string>........
      > </string></value></param><param><value><string>ok
      > </string></value></param><param><value><string>.......
      > </string></value></param><param><value><string>M
      > </string></value></param></params></methodResponse>
      >
      > Here's the client script:
      >
      > #!/usr/bin/perl -w
      >
      > use XMLRPC::Lite;
      >
      > my $res = XMLRPC::Lite
      > -> proxy('http://192.168.0.3:7777')
      > -> call('Util.test', "/home/emm/xmlrpctest")
      > -> result;
      >
      > I tried
      > my @res = $res->paramsin
      > following the soaplite intro at soaplite.com with no avail, I get
      > an
      > error:
      > ==>Can't locate object method "paramsin" via package "Salut mon
      > gros
      >
      > TIA
      >
      > -Emmanuel
      >
      >
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Buy the perfect holiday gifts at Yahoo! Shopping.
      http://shopping.yahoo.com
    • Show all 4 messages in this topic