|
Revision 1843, 0.7 kB
(checked in by nahi, 2 years ago)
|
|
- Property svn:eol-style set to
native
- Property svn:executable set to
*
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
#!/usr/bin/env ruby |
|---|
| 2 |
|
|---|
| 3 |
require 'soap/rpc/cgistub' |
|---|
| 4 |
require 'servant' |
|---|
| 5 |
|
|---|
| 6 |
class Server < SOAP::RPC::CGIStub |
|---|
| 7 |
class DummyServant |
|---|
| 8 |
def push(value) |
|---|
| 9 |
"Not supported" |
|---|
| 10 |
end |
|---|
| 11 |
|
|---|
| 12 |
def pop |
|---|
| 13 |
"Not supported" |
|---|
| 14 |
end |
|---|
| 15 |
end |
|---|
| 16 |
|
|---|
| 17 |
def initialize(*arg) |
|---|
| 18 |
super |
|---|
| 19 |
add_rpc_servant(Servant.new, 'http://tempuri.org/requestScopeService') |
|---|
| 20 |
|
|---|
| 21 |
# Application scope servant is not supported in CGI environment. |
|---|
| 22 |
# See server.rb to support application scope servant. |
|---|
| 23 |
dummy = DummyServant.new |
|---|
| 24 |
add_method_with_namespace('http://tempuri.org/applicationScopeService', dummy, 'push', 'value') |
|---|
| 25 |
add_method_with_namespace('http://tempuri.org/applicationScopeService', dummy, 'pop') |
|---|
| 26 |
end |
|---|
| 27 |
end |
|---|
| 28 |
|
|---|
| 29 |
status = Server.new('Server', nil).start |
|---|