|
Revision 2006, 1.1 kB
(checked in by nahi, 1 year ago)
|
- update tests for the previous change ('in' -> :in)
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
#!/usr/bin/env ruby |
|---|
| 2 |
require 'datetimeServant.rb' |
|---|
| 3 |
|
|---|
| 4 |
require 'soap/rpc/standaloneServer' |
|---|
| 5 |
require 'soap/mapping/registry' |
|---|
| 6 |
|
|---|
| 7 |
class DatetimePortType |
|---|
| 8 |
MappingRegistry = ::SOAP::Mapping::Registry.new |
|---|
| 9 |
|
|---|
| 10 |
Methods = [ |
|---|
| 11 |
["now", "now", |
|---|
| 12 |
[ |
|---|
| 13 |
[:in, "now", [::SOAP::SOAPDateTime]], |
|---|
| 14 |
[:retval, "now", [::SOAP::SOAPDateTime]] |
|---|
| 15 |
], |
|---|
| 16 |
"", "urn:jp.gr.jin.rrr.example.datetime", :rpc |
|---|
| 17 |
] |
|---|
| 18 |
] |
|---|
| 19 |
end |
|---|
| 20 |
|
|---|
| 21 |
class DatetimePortTypeApp < ::SOAP::RPC::StandaloneServer |
|---|
| 22 |
def initialize(*arg) |
|---|
| 23 |
super(*arg) |
|---|
| 24 |
servant = DatetimePortType.new |
|---|
| 25 |
DatetimePortType::Methods.each do |name_as, name, param_def, soapaction, namespace, style| |
|---|
| 26 |
if style == :document |
|---|
| 27 |
@router.add_document_operation(servant, soapaction, name, param_def) |
|---|
| 28 |
else |
|---|
| 29 |
qname = XSD::QName.new(namespace, name_as) |
|---|
| 30 |
@router.add_rpc_operation(servant, qname, soapaction, name, param_def) |
|---|
| 31 |
end |
|---|
| 32 |
end |
|---|
| 33 |
self.mapping_registry = DatetimePortType::MappingRegistry |
|---|
| 34 |
end |
|---|
| 35 |
end |
|---|
| 36 |
|
|---|
| 37 |
if $0 == __FILE__ |
|---|
| 38 |
# Change listen port. |
|---|
| 39 |
server = DatetimePortTypeApp.new('app', nil, '0.0.0.0', 10080) |
|---|
| 40 |
trap(:INT) do |
|---|
| 41 |
server.shutdown |
|---|
| 42 |
end |
|---|
| 43 |
server.start |
|---|
| 44 |
end |
|---|