summaryrefslogtreecommitdiff
path: root/sample/soap/calc
diff options
context:
space:
mode:
Diffstat (limited to 'sample/soap/calc')
-rw-r--r--sample/soap/calc/calc.rb17
-rw-r--r--sample/soap/calc/calc2.rb29
-rw-r--r--sample/soap/calc/client.rb26
-rw-r--r--sample/soap/calc/client2.rb29
-rw-r--r--sample/soap/calc/httpd.rb20
-rw-r--r--sample/soap/calc/samplehttpd.conf2
-rw-r--r--sample/soap/calc/server.cgi15
-rw-r--r--sample/soap/calc/server.rb21
-rw-r--r--sample/soap/calc/server2.rb24
9 files changed, 0 insertions, 183 deletions
diff --git a/sample/soap/calc/calc.rb b/sample/soap/calc/calc.rb
deleted file mode 100644
index 6bc78803b3..0000000000
--- a/sample/soap/calc/calc.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-module CalcService
- def self.add(lhs, rhs)
- lhs + rhs
- end
-
- def self.sub(lhs, rhs)
- lhs - rhs
- end
-
- def self.multi(lhs, rhs)
- lhs * rhs
- end
-
- def self.div(lhs, rhs)
- lhs / rhs
- end
-end
diff --git a/sample/soap/calc/calc2.rb b/sample/soap/calc/calc2.rb
deleted file mode 100644
index e9cf6bbca7..0000000000
--- a/sample/soap/calc/calc2.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-class CalcService2
- def initialize(value = 0)
- @value = value
- end
-
- def set(value)
- @value = value
- end
-
- def get
- @value
- end
-
- def +(rhs)
- @value + rhs
- end
-
- def -(rhs)
- @value - rhs
- end
-
- def *(rhs)
- @value * rhs
- end
-
- def /(rhs)
- @value / rhs
- end
-end
diff --git a/sample/soap/calc/client.rb b/sample/soap/calc/client.rb
deleted file mode 100644
index 57a4c0ba5b..0000000000
--- a/sample/soap/calc/client.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'soap/rpc/driver'
-
-server = ARGV.shift || 'http://localhost:7000/'
-# server = 'http://localhost:8808/server.cgi'
-
-calc = SOAP::RPC::Driver.new(server, 'http://tempuri.org/calcService')
-#calc.wiredump_dev = STDERR
-calc.add_method('add', 'lhs', 'rhs')
-calc.add_method('sub', 'lhs', 'rhs')
-calc.add_method('multi', 'lhs', 'rhs')
-calc.add_method('div', 'lhs', 'rhs')
-
-puts 'add: 1 + 2 # => 3'
-puts calc.add(1, 2)
-puts 'sub: 1.1 - 2.2 # => -1.1'
-puts calc.sub(1.1, 2.2)
-puts 'multi: 1.1 * 2.2 # => 2.42'
-puts calc.multi(1.1, 2.2)
-puts 'div: 5 / 2 # => 2'
-puts calc.div(5, 2)
-puts 'div: 5.0 / 2 # => 2.5'
-puts calc.div(5.0, 2)
-puts 'div: 1.1 / 0 # => Infinity'
-puts calc.div(1.1, 0)
-puts 'div: 1 / 0 # => ZeroDivisionError'
-puts calc.div(1, 0)
diff --git a/sample/soap/calc/client2.rb b/sample/soap/calc/client2.rb
deleted file mode 100644
index 2c53f09d42..0000000000
--- a/sample/soap/calc/client2.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'soap/rpc/driver'
-
-server = ARGV.shift || 'http://localhost:7000/'
-# server = 'http://localhost:8808/server2.cgi'
-
-var = SOAP::RPC::Driver.new( server, 'http://tempuri.org/calcService' )
-var.add_method( 'set', 'newValue' )
-var.add_method( 'get' )
-var.add_method_as( '+', 'add', 'rhs' )
-var.add_method_as( '-', 'sub', 'rhs' )
-var.add_method_as( '*', 'multi', 'rhs' )
-var.add_method_as( '/', 'div', 'rhs' )
-
-puts 'var.set( 1 )'
-puts '# Bare in mind that another client set another value to this service.'
-puts '# This is only a sample for proof of concept.'
-var.set( 1 )
-puts 'var + 2 # => 1 + 2 = 3'
-puts var + 2
-puts 'var - 2.2 # => 1 - 2.2 = -1.2'
-puts var - 2.2
-puts 'var * 2.2 # => 1 * 2.2 = 2.2'
-puts var * 2.2
-puts 'var / 2 # => 1 / 2 = 0'
-puts var / 2
-puts 'var / 2.0 # => 1 / 2.0 = 0.5'
-puts var / 2.0
-puts 'var / 0 # => 1 / 0 => ZeroDivisionError'
-puts var / 0
diff --git a/sample/soap/calc/httpd.rb b/sample/soap/calc/httpd.rb
deleted file mode 100644
index bebcff96c6..0000000000
--- a/sample/soap/calc/httpd.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'webrick'
-require 'soap/property'
-
-docroot = "."
-port = 8808
-if opt = SOAP::Property.loadproperty("samplehttpd.conf")
- docroot = opt["docroot"]
- port = Integer(opt["port"])
-end
-
-s = WEBrick::HTTPServer.new(
- :BindAddress => "0.0.0.0",
- :Port => port,
- :DocumentRoot => docroot,
- :CGIPathEnv => ENV['PATH']
-)
-trap(:INT){ s.shutdown }
-s.start
diff --git a/sample/soap/calc/samplehttpd.conf b/sample/soap/calc/samplehttpd.conf
deleted file mode 100644
index 85e9995021..0000000000
--- a/sample/soap/calc/samplehttpd.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-docroot = .
-port = 8808
diff --git a/sample/soap/calc/server.cgi b/sample/soap/calc/server.cgi
deleted file mode 100644
index c4fa687550..0000000000
--- a/sample/soap/calc/server.cgi
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'soap/rpc/cgistub'
-
-class CalcServer < SOAP::RPC::CGIStub
- def initialize(*arg)
- super
-
- require 'calc'
- servant = CalcService
- add_servant(servant, 'http://tempuri.org/calcService')
- end
-end
-
-status = CalcServer.new('CalcServer', nil).start
diff --git a/sample/soap/calc/server.rb b/sample/soap/calc/server.rb
deleted file mode 100644
index 97661be9d3..0000000000
--- a/sample/soap/calc/server.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
diff --git a/sample/soap/calc/server2.rb b/sample/soap/calc/server2.rb
deleted file mode 100644
index bb0f643d77..0000000000
--- a/sample/soap/calc/server2.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'soap/rpc/standaloneServer'
-require 'calc2'
-
-class CalcServer2 < SOAP::RPC::StandaloneServer
- def on_init
- servant = CalcService2.new
- add_method(servant, 'set', 'newValue')
- add_method(servant, 'get')
- add_method_as(servant, '+', 'add', 'lhs')
- add_method_as(servant, '-', 'sub', 'lhs')
- add_method_as(servant, '*', 'multi', 'lhs')
- add_method_as(servant, '/', 'div', 'lhs')
- end
-end
-
-if $0 == __FILE__
- server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000)
- trap(:INT) do
- server.shutdown
- end
- status = server.start
-end