diff options
author | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-15 14:47:07 +0000 |
---|---|---|
committer | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-15 14:47:07 +0000 |
commit | caf6ad3a760f4fb0a27bb8e483f3f6ad9de707f0 (patch) | |
tree | 7eb17be0ca672f580224b641611a99ddc8e9b897 /test/wsdl/any/expectedDriver.rb | |
parent | b8bc87839d722c8cf89b6fbfbb8b4a59c8f6b6a9 (diff) | |
download | ruby-caf6ad3a760f4fb0a27bb8e483f3f6ad9de707f0.tar.gz |
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/wsdl/any/expectedDriver.rb')
-rw-r--r-- | test/wsdl/any/expectedDriver.rb | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/wsdl/any/expectedDriver.rb b/test/wsdl/any/expectedDriver.rb new file mode 100644 index 0000000000..6d1827fb94 --- /dev/null +++ b/test/wsdl/any/expectedDriver.rb @@ -0,0 +1,54 @@ +require 'echo.rb' + +require 'soap/rpc/driver' + +class Echo_port_type < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:10080" + MappingRegistry = ::SOAP::Mapping::Registry.new + + MappingRegistry.set( + FooBar, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") } + ) + + Methods = [ + [ XSD::QName.new("urn:example.com:echo", "echo"), + "urn:example.com:echo", + "echo", + [ ["in", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]], + ["retval", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + |