|
Revision 2006, 1.3 kB
(checked in by nahi, 1 year ago)
|
- update tests for the previous change ('in' -> :in)
|
| Line | |
|---|
| 1 |
require 'product.rb' |
|---|
| 2 |
require 'productMappingRegistry.rb' |
|---|
| 3 |
require 'soap/rpc/driver' |
|---|
| 4 |
|
|---|
| 5 |
module WSDL::Ref |
|---|
| 6 |
|
|---|
| 7 |
class Ref_porttype < ::SOAP::RPC::Driver |
|---|
| 8 |
DefaultEndpointUrl = "http://localhost:17171/" |
|---|
| 9 |
|
|---|
| 10 |
Methods = [ |
|---|
| 11 |
[ "urn:ref:echo", |
|---|
| 12 |
"echo", |
|---|
| 13 |
[ [:in, "parameters", ["::SOAP::SOAPElement", "urn:ref", "Product-Bag"]], |
|---|
| 14 |
[:out, "parameters", ["::SOAP::SOAPElement", "urn:ref", "Creator"]] ], |
|---|
| 15 |
{ :request_style => :document, :request_use => :literal, |
|---|
| 16 |
:response_style => :document, :response_use => :literal, |
|---|
| 17 |
:faults => {} } |
|---|
| 18 |
] |
|---|
| 19 |
] |
|---|
| 20 |
|
|---|
| 21 |
def initialize(endpoint_url = nil) |
|---|
| 22 |
endpoint_url ||= DefaultEndpointUrl |
|---|
| 23 |
super(endpoint_url, nil) |
|---|
| 24 |
self.mapping_registry = ProductMappingRegistry::EncodedRegistry |
|---|
| 25 |
self.literal_mapping_registry = ProductMappingRegistry::LiteralRegistry |
|---|
| 26 |
init_methods |
|---|
| 27 |
end |
|---|
| 28 |
|
|---|
| 29 |
private |
|---|
| 30 |
|
|---|
| 31 |
def init_methods |
|---|
| 32 |
Methods.each do |definitions| |
|---|
| 33 |
opt = definitions.last |
|---|
| 34 |
if opt[:request_style] == :document |
|---|
| 35 |
add_document_operation(*definitions) |
|---|
| 36 |
else |
|---|
| 37 |
add_rpc_operation(*definitions) |
|---|
| 38 |
qname = definitions[0] |
|---|
| 39 |
name = definitions[2] |
|---|
| 40 |
if qname.name != name and qname.name.capitalize == name.capitalize |
|---|
| 41 |
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| |
|---|
| 42 |
__send__(name, *arg) |
|---|
| 43 |
end |
|---|
| 44 |
end |
|---|
| 45 |
end |
|---|
| 46 |
end |
|---|
| 47 |
end |
|---|
| 48 |
end |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
end |
|---|