summaryrefslogtreecommitdiff
path: root/sample/soap/calc/server.rb
blob: 97661be9d3d5413e7eb0f4271ccbfb6a9a02dedc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

require 'soap/rpc/standaloneServer'
require 'calc'

class CalcServer < SOAP::RPC::StandaloneServer
  def initialize(*arg)
    super

    servant = CalcService
    add_servant(servant, 'http://tempuri.org/calcService')
  end
end

if $0 == __FILE__
  server = CalcServer.new('CalcServer', nil, '0.0.0.0', 7000)
  trap(:INT) do
    server.shutdown
  end
  server.start
end