in reply to Frontier::Client and <struct>

A hash (or rather a reference to a hash) generates a "struct":
use Modern::Perl; use Frontier::Client; my $server = Frontier::Client->new( 'url' => 'http://my.server.com/RPC +2', debug => 1 ); my $result = $server->call('MyCall', {test1 => "one", test2 => 'two'}) +;
Output:
---- request ---- <?xml version="1.0"?> <methodCall> <methodName>MyCall</methodName> <params> <param><value><struct> <member> <name>test1</name> <value><string>one</string></value> </member> <member> <name>test2</name> <value><string>two</string></value> </member> </struct></value></param> </params> </methodCall>

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Frontier::Client and <struct>
by DreamT (Pilgrim) on Mar 23, 2011 at 11:20 UTC
    Thank you, worked great:)

    Any idea how to get the fields (hash) ordered? Looking in the source, I can't see how it can be possible :-/
      Try
      use Tie::IxHash; tie(%myhash, 'Tie::IxHash', test1 => "one", test2 => 'two' ); my $result = $server->call('MyCall', \%myhash );
      Mmm, interesting.

      And why would you need the fields to be ordered?

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James