summaryrefslogtreecommitdiff
path: root/sample/soap/helloworld
diff options
context:
space:
mode:
Diffstat (limited to 'sample/soap/helloworld')
-rw-r--r--sample/soap/helloworld/hw_c.rb6
-rw-r--r--sample/soap/helloworld/hw_s.rb17
2 files changed, 23 insertions, 0 deletions
diff --git a/sample/soap/helloworld/hw_c.rb b/sample/soap/helloworld/hw_c.rb
new file mode 100644
index 0000000000..253d0a409b
--- /dev/null
+++ b/sample/soap/helloworld/hw_c.rb
@@ -0,0 +1,6 @@
+require 'soap/rpc/driver'
+
+s = SOAP::RPC::Driver.new('http://localhost:2000/', 'urn:hws')
+s.add_method("hello_world", "from")
+
+p s.hello_world(self.to_s)
diff --git a/sample/soap/helloworld/hw_s.rb b/sample/soap/helloworld/hw_s.rb
new file mode 100644
index 0000000000..b917f72fc0
--- /dev/null
+++ b/sample/soap/helloworld/hw_s.rb
@@ -0,0 +1,17 @@
+require 'soap/rpc/standaloneServer'
+
+class HelloWorldServer < SOAP::RPC::StandaloneServer
+ def on_init
+ @log.level = Logger::Severity::DEBUG
+ add_method(self, 'hello_world', 'from')
+ end
+
+ def hello_world(from)
+ "Hello World, from #{ from }"
+ end
+end
+
+if $0 == __FILE__
+ server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000)
+ server.start
+end