Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/trunk/sample/basic/calc/server2.rb

Revision 1843, 0.6 kB (checked in by nahi, 2 years ago)
  • reorganize sampless
  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1 #!/usr/bin/env ruby
2
3 require 'soap/rpc/standaloneServer'
4 require 'calc2'
5
6 class CalcServer2 < SOAP::RPC::StandaloneServer
7   def on_init
8     servant = CalcService2.new
9     add_method(servant, 'set', 'newValue')
10     add_method(servant, 'get')
11     add_method_as(servant, '+', 'add', 'lhs')
12     add_method_as(servant, '-', 'sub', 'lhs')
13     add_method_as(servant, '*', 'multi', 'lhs')
14     add_method_as(servant, '/', 'div', 'lhs')
15   end
16 end
17
18 if $0 == __FILE__
19   server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000)
20   trap(:INT) do
21     server.shutdown
22   end
23   status = server.start
24 end
Note: See TracBrowser for help on using the browser.