in reply to Frontier::Client and getting right XML output

First things first. This part right here:

my %paramfields = [{ 'this' => 'thisvalue', 'that' => 'thatvalue', 'something' => 'somevalue' }];
That is pretty messed up. You are assigning, to a hash table, a single value that is an array reference, whose first (and only) element is a hash reference. This array reference would be the key, but there is no value to go with it. I suspect that you meant to create an array @paramfields that has all the parameters you plan to pass to the call.

Based on what you coded, the Frontier client did in fact encode it correctly.

And just because it's me, I feel obligated to promote RPC::XML, which I feel is more actively maintained than Frontier (though I haven't been very active these past few months).

--rjray

Replies are listed 'Best First'.
Re: Re: Frontier::Client and getting right XML output
by inblosam (Monk) on May 21, 2004 at 00:46 UTC
    Thanks, I need some fine-tuning to my array/hash skills. It works perfect now!!

    While I have your attention, I am a bit confused by the RPC::XML module and how to use it, as easy as with Frontier. I would happily use it if I knew how to!

    use RPC::XML; $req = RPC::XML::request->new('fetch_prime_factors', RPC::XML::int->new(985120528)); ... $resp = RPC::XML::Parser->new()->parse(STREAM); if (ref($resp)) { return $resp->value->value; } else { die $resp; }

    Where do I specify the server address (http://somerpcserversite.com/server.php) and then can I just pass in the arguments like the array above? Where do I do that?

    THANKS!

      Oh dear-- you shouldn't need to instantiate RPC::XML::Parser yourself. Look at the RPC::XML::Client class. You instantiate it with the HTTP URL of the service you want to talk to. Then you can make calls and get back data-objects as results.

      --rjray