/[cvs]/joko/TestArea/perl/runtime/POE/rpc/rpcxml/nonpoe_client.plx
ViewVC logotype

Contents of /joko/TestArea/perl/runtime/POE/rpc/rpcxml/nonpoe_client.plx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Sun May 11 21:48:57 2003 UTC (21 years, 1 month ago) by joko
Branch: MAIN
CVS Tags: HEAD
initial commit

1 #!/usr/bin/perl
2
3 use strict;
4
5 use RPC::XML::Client ();
6 use Data::Dumper qw( Dumper );
7
8 ##
9 ## Define shorthand for RPC::XML::type
10 ##
11 BEGIN {
12 my %short = (
13 array => 'a', struct => 's',
14 int => 'i', double => 'd',
15 boolean => 'b', string => 'S',
16 base64 => 'b64', fault => 'f',
17 datetime_iso8601 => 'dt',
18 );
19
20 eval qq{{package R::X::$short{$_};sub new{shift;RPC::XML::$_->new(\@_)}}}
21 foreach keys %short;
22 }
23
24 use constant DEFAULT_URL => 'http://localhost:7777/';
25
26 my $url = shift || DEFAULT_URL;
27
28 my $cl = RPC::XML::Client->new( $url );
29
30
31 my $req = RPC::XML::request->new(
32 'spoo',
33 R::X::a->new( 1, 2, 3, 4, ),
34 );
35
36
37 #my $req = RPC::XML::request->new( 'system.introspection', );
38
39 #print "request\n", $req->as_string, "\n";
40
41 my $resp = $cl->send_request( $req );
42
43 if( ref $resp ) {
44 print "response:\n", Dumper( $resp->value ), "\n"
45 } else {
46 print "Error: $resp\n";
47 }
48
49 =pod
50 my $i = 0;
51 foreach ( @{$resp->value->value} ) {
52 print $i++, ": ", $_, "\n";
53 }
54 =cut
55
56 exit 0;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed