| 1 |
require 'echo.rb' |
|---|
| 2 |
require 'echoMappingRegistry.rb' |
|---|
| 3 |
require 'soap/rpc/driver' |
|---|
| 4 |
|
|---|
| 5 |
module WSDL::Any |
|---|
| 6 |
|
|---|
| 7 |
class Echo_port_type < ::SOAP::RPC::Driver |
|---|
| 8 |
DefaultEndpointUrl = "http://localhost:10080" |
|---|
| 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 |
|
|---|
| 38 |
def initialize(endpoint_url = nil) |
|---|
| 39 |
endpoint_url ||= DefaultEndpointUrl |
|---|
| 40 |
super(endpoint_url, nil) |
|---|
| 41 |
self.mapping_registry = EchoMappingRegistry::EncodedRegistry |
|---|
| 42 |
self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry |
|---|
| 43 |
init_methods |
|---|
| 44 |
end |
|---|
| 45 |
|
|---|
| 46 |
private |
|---|
| 47 |
|
|---|
| 48 |
def init_methods |
|---|
| 49 |
Methods.each do |definitions| |
|---|
| 50 |
opt = definitions.last |
|---|
| 51 |
if opt[:request_style] == :document |
|---|
| 52 |
add_document_operation(*definitions) |
|---|
| 53 |
else |
|---|
| 54 |
add_rpc_operation(*definitions) |
|---|
| 55 |
qname = definitions[0] |
|---|
| 56 |
name = definitions[2] |
|---|
| 57 |
if qname.name != name and qname.name.capitalize == name.capitalize |
|---|
| 58 |
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| |
|---|
| 59 |
__send__(name, *arg) |
|---|
| 60 |
end |
|---|
| 61 |
end |
|---|
| 62 |
end |
|---|
| 63 |
end |
|---|
| 64 |
end |
|---|
| 65 |
end |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
end |
|---|