ruby/sample/soap/swa/server.rb
(no author) 5548c7bff2 This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-03 15:38:36 +00:00

23 lines
458 B
Ruby

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