| 1 |
#!/usr/bin/env ruby |
|---|
| 2 |
require 'echoServant.rb' |
|---|
| 3 |
require 'echoMappingRegistry.rb' |
|---|
| 4 |
require 'soap/rpc/standaloneServer' |
|---|
| 5 |
|
|---|
| 6 |
module WSDL; module Any |
|---|
| 7 |
|
|---|
| 8 |
class Echo_port_type |
|---|
| 9 |
NsEcho = "urn:example.com:echo" |
|---|
| 10 |
|
|---|
| 11 |
Methods = [ |
|---|
| 12 |
[ "urn:example.com:echo", |
|---|
| 13 |
"echo", |
|---|
| 14 |
[ [:in, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "foo.bar"]], |
|---|
| 15 |
[:out, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "foo.bar"]] ], |
|---|
| 16 |
{ :request_style => :document, :request_use => :literal, |
|---|
| 17 |
:response_style => :document, :response_use => :literal, |
|---|
| 18 |
:faults => {} } |
|---|
| 19 |
], |
|---|
| 20 |
[ XSD::QName.new(NsEcho, "echoAny"), |
|---|
| 21 |
"urn:example.com:echoAny", |
|---|
| 22 |
"echoAny", |
|---|
| 23 |
[ [:retval, "echoany_return", [nil]] ], |
|---|
| 24 |
{ :request_style => :rpc, :request_use => :encoded, |
|---|
| 25 |
:response_style => :rpc, :response_use => :encoded, |
|---|
| 26 |
:faults => {} } |
|---|
| 27 |
], |
|---|
| 28 |
[ "urn:example.com:echo", |
|---|
| 29 |
"setOutputAndComplete", |
|---|
| 30 |
[ [:in, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "setOutputAndCompleteRequest"]], |
|---|
| 31 |
[:out, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "setOutputAndCompleteRequest"]] ], |
|---|
| 32 |
{ :request_style => :document, :request_use => :literal, |
|---|
| 33 |
:response_style => :document, :response_use => :literal, |
|---|
| 34 |
:faults => {} } |
|---|
| 35 |
] |
|---|
| 36 |
] |
|---|
| 37 |
end |
|---|
| 38 |
|
|---|
| 39 |
end; end |
|---|
| 40 |
|
|---|
| 41 |
module WSDL; module Any |
|---|
| 42 |
|
|---|
| 43 |
class Echo_port_typeApp < ::SOAP::RPC::StandaloneServer |
|---|
| 44 |
def initialize(*arg) |
|---|
| 45 |
super(*arg) |
|---|
| 46 |
servant = WSDL::Any::Echo_port_type.new |
|---|
| 47 |
WSDL::Any::Echo_port_type::Methods.each do |definitions| |
|---|
| 48 |
opt = definitions.last |
|---|
| 49 |
if opt[:request_style] == :document |
|---|
| 50 |
@router.add_document_operation(servant, *definitions) |
|---|
| 51 |
else |
|---|
| 52 |
@router.add_rpc_operation(servant, *definitions) |
|---|
| 53 |
end |
|---|
| 54 |
end |
|---|
| 55 |
self.mapping_registry = EchoMappingRegistry::EncodedRegistry |
|---|
| 56 |
self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry |
|---|
| 57 |
end |
|---|
| 58 |
end |
|---|
| 59 |
|
|---|
| 60 |
end; end |
|---|
| 61 |
|
|---|
| 62 |
if $0 == __FILE__ |
|---|
| 63 |
# Change listen port. |
|---|
| 64 |
server = WSDL::Any::Echo_port_typeApp.new('app', nil, '0.0.0.0', 10080) |
|---|
| 65 |
trap(:INT) do |
|---|
| 66 |
server.shutdown |
|---|
| 67 |
end |
|---|
| 68 |
server.start |
|---|
| 69 |
end |
|---|