File: server2.rb

package info (click to toggle)
soap4r 1.4.8-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,472 kB
  • ctags: 2,206
  • sloc: ruby: 19,295; makefile: 58; sh: 41; perl: 10
file content (19 lines) | stat: -rwxr-xr-x 574 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby

require 'soap/standaloneServer'
class CalcServer < SOAP::StandaloneServer
  def methodDef
    require 'calc2'
    aServant = CalcService2.new
    addMethod( aServant, 'set', 'newValue' )
    addMethod( aServant, 'get' )
    addMethodAs( aServant, '+', 'add', 'lhs' )
    addMethodAs( aServant, '-', 'sub', 'lhs' )
    addMethodAs( aServant, '*', 'multi', 'lhs' )
    addMethodAs( aServant, '/', 'div', 'lhs' )
  end
end

# Stop this program with Ctrl-C.
status = CalcServer.new( 'CalcServer', 'http://tempuri.org/calcService',
  '0.0.0.0', 7000 ).start