5 my $serverURL='http://localhost/demo/server/server.php';
7 # try the simplest example
9 my $client = Frontier::Client->new(
10 'url' => $serverURL, 'debug' => 0, 'encoding' => 'iso-8859-1'
12 my $resp = $client->call("examples.getStateName", 32);
14 print "Got '${resp}'\n";
16 # now send a mail to nobody in particular
18 #$resp = $client->call("mail.send", (
21 # "Bonjour. Je m'appelle Gérard. Mañana. ",
25 # 'text/plain; charset="iso-8859-1"')
28 #if ($resp->value()) {
29 # print "Mail sent OK.\n";
31 # print "Error sending mail.\n";
34 # test echoing of characters works fine
36 $resp = $client->call("examples.echo", 'Three "blind" mice - ' . "See 'how' they run");
39 # test name and age example. this exercises structs and arrays
41 $resp = $client->call("examples.sortByAge",
43 { 'name' => 'Dave', 'age' => 35},
44 { 'name' => 'Edd', 'age' => 45 },
45 { 'name' => 'Fred', 'age' => 23 },
46 { 'name' => 'Barney', 'age' => 36 }
52 print $$e{'name'} . ", " . $$e{'age'} . "\n";
57 $resp = $client->call("examples.decode64",
58 $client->base64("TWFyeSBoYWQgYSBsaXR0bGUgbGFtYiBTaGUgdGllZCBpdCB0byBhIHB5bG9u")