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_gzip.rb8
-rw-r--r--sample/soap/helloworld/hw_s_gzip.rb21
2 files changed, 29 insertions, 0 deletions
diff --git a/sample/soap/helloworld/hw_c_gzip.rb b/sample/soap/helloworld/hw_c_gzip.rb
new file mode 100644
index 0000000000..3335b5f571
--- /dev/null
+++ b/sample/soap/helloworld/hw_c_gzip.rb
@@ -0,0 +1,8 @@
+require 'soap/rpc/driver'
+
+s = SOAP::RPC::Driver.new('http://localhost:2000/', 'urn:hws')
+s.add_method("hello_world", "from")
+#s.wiredump_dev = STDOUT # care about binary output.
+s.streamhandler.accept_encoding_gzip = true
+
+p s.hello_world(self.to_s)
diff --git a/sample/soap/helloworld/hw_s_gzip.rb b/sample/soap/helloworld/hw_s_gzip.rb
new file mode 100644
index 0000000000..d124df0e04
--- /dev/null
+++ b/sample/soap/helloworld/hw_s_gzip.rb
@@ -0,0 +1,21 @@
+require 'soap/rpc/standaloneServer'
+
+class HelloWorldServer < SOAP::RPC::StandaloneServer
+ def on_init
+ @soaplet.allow_content_encoding_gzip = true
+ @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)
+ trap(:INT) do
+ server.shutdown
+ end
+ server.start
+end