diff options
| author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-20 14:00:21 +0000 |
|---|---|---|
| committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-20 14:00:21 +0000 |
| commit | 921e6c5131ee69790d108bc13a5b08c21e50e306 (patch) | |
| tree | 5604e10b00870c4facd7b7627a8899273dca092a /sample/soap/helloworld | |
| parent | f373221dd3deca96c8090460e1632654ac0793e3 (diff) | |
* added samples for the previous soap4r's commit.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/soap/helloworld')
| -rw-r--r-- | sample/soap/helloworld/hw_c_gzip.rb | 8 | ||||
| -rw-r--r-- | sample/soap/helloworld/hw_s.rb | 3 | ||||
| -rw-r--r-- | sample/soap/helloworld/hw_s_gzip.rb | 21 |
3 files changed, 32 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 000000000..3335b5f57 --- /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.rb b/sample/soap/helloworld/hw_s.rb index b917f72fc..f9f819a19 100644 --- a/sample/soap/helloworld/hw_s.rb +++ b/sample/soap/helloworld/hw_s.rb @@ -13,5 +13,8 @@ end if $0 == __FILE__ server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000) + trap(:INT) do + server.shutdown + end server.start end diff --git a/sample/soap/helloworld/hw_s_gzip.rb b/sample/soap/helloworld/hw_s_gzip.rb new file mode 100644 index 000000000..d124df0e0 --- /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 |
