12 my $host = 'http://localhost';
17 'verbose' => \$verbose,
21 $host =~ /^\S+:\/\// or $host = 'http://' . $host;
22 $host =~ /:\d+$/ or $host .= ':10080';
25 print "Trying host: $host\n";
27 my $client = new RPC::XML::Client($host);
29 my $insertblock = <<END_OF_CHUNK ;
30 Channel: zap1/614260xxxx
38 Set: titlestring=Akira, Huckleberry Finn
45 $_ eq 'inject' and push @commands, $insertblock;
48 push @commands, 'retrieve'; # default
51 print "Sending request: \n ", join("\n ", @commands), "\n\n";
52 my $resp = $client->send_request(@commands);
55 print "Return is " . ref($resp), "\n";
56 # print "Code: ", ($resp->{code}->as_string || 'UNKNOWN'), "\n";
57 foreach (qw(code faultcode)) {
58 my $code = $resp->{$_};
60 print " ", ucfirst($_), ": ";
61 print $code ? $code->value : 'UNKNOWN';
66 print "ERROR: unrecognized response:\n\n", Dumper($resp), "\n";
68 $verbose and print Dumper($resp);
69 $verbose and print "\nKEYS (level 1):\n",
70 map {sprintf "%12s: %s\n", $_, scalar $resp->{$_}->value} sort keys %$resp;
72 # print "spooled_filename: ", $resp->{spooled_filename}->value, "\n";