1 use Frontier::Client;
 2 
 3 # Perl client example, xmlBlaster.org
 4 # @author David Kelly davidk@navahonetworks.com
 5 # @author Russell Chan russ@navahonetworks.com
 6     
 7 #$server_url = 'http://MyHost:8080/';
 8 $server_url =  @ARGV[0];
 9 print "\nTrying to connect to xmlBlaster server on $server_url ...\n";
10 
11 # Make an object to represent the XMLRPC server.
12 $server = Frontier::Client->new(url => $server_url);
13 print "Connected to xmlBlaster server on $server_url \n";
14 
15 # Call the remote server and get our result.
16 $sessionId = $server->call('authenticate.login', "dk", "dk", "<qos><local>false</local></qos>", "");
17 print "\nLogin success with sessionId=$sessionId \n";
18 
19 my $c=0;
20 while ($c++ < 100) {
21         $message = $server->call('xmlBlaster.publish', $sessionId,
22 "<key oid='' contentMime='text/xml'><service>post</service><type>request</type><id>123</id></key>",
23 "<tag>Hello World</tag>", "<qos><expiration lifeTime='0'/><persistent>false</persistent></qos>");
24         print "published... $c\n";
25         sleep(2);
26 }
27 
28 
29 # Logout from xmlBlaster
30 #$server->call('authenticate.logout', $sessionId);
31 print "\nLogout done, bye.\n";


syntax highlighted by Code2HTML, v. 0.9.1