diff options
| author | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-03 15:38:36 +0000 |
|---|---|---|
| committer | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-03 15:38:36 +0000 |
| commit | 6133b96d61c705c7aefdf6f577f0da5796bc522d (patch) | |
| tree | ce6b571d063d031d1b5cba3ba7671ca138405a3a /sample/soap/swa | |
| parent | 70105b2706511a6358a32b805fb55f187e942698 (diff) | |
| download | ruby-6133b96d61c705c7aefdf6f577f0da5796bc522d.tar.gz ruby-6133b96d61c705c7aefdf6f577f0da5796bc522d.tar.xz ruby-6133b96d61c705c7aefdf6f577f0da5796bc522d.zip | |
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/soap/swa')
| -rw-r--r-- | sample/soap/swa/client.rb | 13 | ||||
| -rw-r--r-- | sample/soap/swa/server.rb | 23 |
2 files changed, 36 insertions, 0 deletions
diff --git a/sample/soap/swa/client.rb b/sample/soap/swa/client.rb new file mode 100644 index 000000000..01c59a384 --- /dev/null +++ b/sample/soap/swa/client.rb @@ -0,0 +1,13 @@ +require 'soap/rpc/driver' +require 'soap/attachment' + +server = 'http://localhost:7000/' +driver = SOAP::RPC::Driver.new(server, 'http://www.acmetron.com/soap') +driver.wiredump_dev = STDERR +driver.add_method('get_file') +driver.add_method('put_file', 'name', 'file') + +p driver.get_file +file = File.open($0) +attach = SOAP::Attachment.new(file) +p driver.put_file($0, attach) diff --git a/sample/soap/swa/server.rb b/sample/soap/swa/server.rb new file mode 100644 index 000000000..0a82fe58b --- /dev/null +++ b/sample/soap/swa/server.rb @@ -0,0 +1,23 @@ +require 'soap/rpc/standaloneServer' +require 'soap/attachment' + +class SwAService + def get_file + return { + 'name' => $0, + 'file' => SOAP::Attachment.new(File.open($0)) + } + end + + def put_file(name, file) + "File '#{name}' was received ok." + end +end + +server = SOAP::RPC::StandaloneServer.new('SwAServer', + 'http://www.acmetron.com/soap', '0.0.0.0', 7000) +server.add_servant(SwAService.new) +trap(:INT) do + server.shutdown +end +server.start |
