diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-28 05:53:16 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-28 05:53:16 +0000 |
commit | 42bca643c3ec41782d519c7676383f8f71e67a7a (patch) | |
tree | 3ddde51774247d839f4e12ae0d9af6ff2e84d35b /test/wsdl/raa | |
parent | a017b0cc8aea236600d47ff04cd829f84499f414 (diff) |
* lib/soap/streamHandler.rb: drop unused http parameters.
* lib/soap/encodingstyle/soapHandler.rb, lib/soap/mapping/factory.rb,
lib/soap/mapping/mapping.rb, lib/soap/mapping/registry.rb,
lib/wsdl/soap/complexType.rb: ApacheSOAP's map support was broken under WSDL
dynanic client environment. fixed.
* test/wsdl/raa/*: add tests.
* lib/xsd/datatypes.rb: dateTime precision bug fix (at least, I hope.) bug of
soap4r. XSDDateTimeImple.to_time passed a Float to Time.local/Time.gm as an
usec, and NUM2LONG(rb_num2long for Float) causes rounding error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/wsdl/raa')
-rw-r--r-- | test/wsdl/raa/RAA.rb | 15 | ||||
-rw-r--r-- | test/wsdl/raa/RAAServant.rb | 99 | ||||
-rw-r--r-- | test/wsdl/raa/RAAService.rb (renamed from test/wsdl/raa/server.rb) | 41 | ||||
-rw-r--r-- | test/wsdl/raa/README.txt | 5 | ||||
-rw-r--r-- | test/wsdl/raa/test_raa.rb | 6 |
5 files changed, 128 insertions, 38 deletions
diff --git a/test/wsdl/raa/RAA.rb b/test/wsdl/raa/RAA.rb index 32b88bd26a..aff0525480 100644 --- a/test/wsdl/raa/RAA.rb +++ b/test/wsdl/raa/RAA.rb @@ -235,20 +235,9 @@ class StringArray < Array end # http://xml.apache.org/xml-soap -class Map +class Map < Array + # Contents type should be dumped here... @@schema_type = "Map" @@schema_ns = "http://xml.apache.org/xml-soap" - - def item - @item - end - - def item=(value) - @item = value - end - - def initialize(item = nil) - @item = item - end end diff --git a/test/wsdl/raa/RAAServant.rb b/test/wsdl/raa/RAAServant.rb new file mode 100644 index 0000000000..68380f8e48 --- /dev/null +++ b/test/wsdl/raa/RAAServant.rb @@ -0,0 +1,99 @@ +class RAABaseServicePortType + # SYNOPSIS + # getAllListings + # + # ARGS + # N/A + # + # RETURNS + # return StringArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}StringArray + # + # RAISES + # (undefined) + # + def getAllListings + #raise NotImplementedError.new + ["ruby", "soap4r"] + end + + # SYNOPSIS + # getProductTree + # + # ARGS + # N/A + # + # RETURNS + # return Map - {http://xml.apache.org/xml-soap}Map + # + # RAISES + # (undefined) + # + def getProductTree + raise NotImplementedError.new + end + + # SYNOPSIS + # getInfoFromCategory(category) + # + # ARGS + # category Category - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Category + # + # RETURNS + # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray + # + # RAISES + # (undefined) + # + def getInfoFromCategory(category) + raise NotImplementedError.new + end + + # SYNOPSIS + # getModifiedInfoSince(timeInstant) + # + # ARGS + # timeInstant - {http://www.w3.org/2001/XMLSchema}dateTime + # + # RETURNS + # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray + # + # RAISES + # (undefined) + # + def getModifiedInfoSince(timeInstant) + raise NotImplementedError.new + end + + # SYNOPSIS + # getInfoFromName(productName) + # + # ARGS + # productName - {http://www.w3.org/2001/XMLSchema}string + # + # RETURNS + # return Info - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Info + # + # RAISES + # (undefined) + # + def getInfoFromName(productName) + raise NotImplementedError.new + end + + # SYNOPSIS + # getInfoFromOwnerId(ownerId) + # + # ARGS + # ownerId - {http://www.w3.org/2001/XMLSchema}int + # + # RETURNS + # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray + # + # RAISES + # (undefined) + # + def getInfoFromOwnerId(ownerId) + raise NotImplementedError.new + end +end + diff --git a/test/wsdl/raa/server.rb b/test/wsdl/raa/RAAService.rb index 95e63dcd31..42cdfaea47 100644 --- a/test/wsdl/raa/server.rb +++ b/test/wsdl/raa/RAAService.rb @@ -1,6 +1,7 @@ #!/usr/bin/env ruby +require 'RAAServant.rb' + require 'soap/rpc/standaloneServer' -require 'RAA.rb' class RAABaseServicePortType MappingRegistry = SOAP::Mapping::Registry.new @@ -13,9 +14,9 @@ class RAABaseServicePortType ) MappingRegistry.set( Map, - ::SOAP::SOAPStruct, - ::SOAP::Mapping::Registry::TypedStructFactory, - { :type => XSD::QName.new("http://xml.apache.org/xml-soap", "Map") } + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") } ) MappingRegistry.set( Category, @@ -47,48 +48,39 @@ class RAABaseServicePortType ::SOAP::Mapping::Registry::TypedStructFactory, { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") } ) - + + Methods = [ ["getAllListings", "getAllListings", [ ["retval", "return", - [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], - "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], + [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], ["getProductTree", "getProductTree", [ ["retval", "return", - [::SOAP::SOAPStruct, "http://xml.apache.org/xml-soap", "Map"]]], - "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], + [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], ["getInfoFromCategory", "getInfoFromCategory", [ ["in", "category", [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]], ["retval", "return", - [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], - "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], + [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], ["getModifiedInfoSince", "getModifiedInfoSince", [ ["in", "timeInstant", [SOAP::SOAPDateTime]], ["retval", "return", - [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], - "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], + [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], ["getInfoFromName", "getInfoFromName", [ ["in", "productName", [SOAP::SOAPString]], ["retval", "return", - [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], - "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], + [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"], ["getInfoFromOwnerId", "getInfoFromOwnerId", [ ["in", "ownerId", [SOAP::SOAPInt]], ["retval", "return", - [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], - "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"] + [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"] ] - - def getAllListings - ["ruby", "soap4r"] - end end -class RAABaseServiceServer < SOAP::RPC::StandaloneServer +class App < SOAP::RPC::StandaloneServer def initialize(*arg) super @@ -102,3 +94,8 @@ class RAABaseServiceServer < SOAP::RPC::StandaloneServer self.mapping_registry = RAABaseServicePortType::MappingRegistry end end + +# Change listen port. +if $0 == __FILE__ + App.new('app', nil, '0.0.0.0', 10080).start +end diff --git a/test/wsdl/raa/README.txt b/test/wsdl/raa/README.txt index e884db9bb4..efbaf9d87c 100644 --- a/test/wsdl/raa/README.txt +++ b/test/wsdl/raa/README.txt @@ -1,4 +1,7 @@ -server.rb: based on RAAService.rb which is generated with the following command; +RAAServant.rb: based on the file which is generated with the following command; + bin/wsdl2ruby.rb --wsdl raa.wsdl --servant_skelton --force + +RAAService.rb: generated with the following command; bin/wsdl2ruby.rb --wsdl raa.wsdl --standalone_server_stub --force RAA.rb: generated with the following command; diff --git a/test/wsdl/raa/test_raa.rb b/test/wsdl/raa/test_raa.rb index f90c6222f4..86452a0b40 100644 --- a/test/wsdl/raa/test_raa.rb +++ b/test/wsdl/raa/test_raa.rb @@ -18,9 +18,11 @@ class TestRAA < Test::Unit::TestCase def setup_server $:.push(DIR) - require File.join(DIR, 'server.rb') + require File.join(DIR, 'RAA.rb') + require File.join(DIR, 'RAAServant.rb') + require File.join(DIR, 'RAAService.rb') $:.delete(DIR) - @server = RAABaseServiceServer.new('RAA server', nil, '0.0.0.0', Port) + @server = App.new('RAA server', nil, '0.0.0.0', Port) @server.level = Logger::Severity::ERROR @t = Thread.new { Thread.current.abort_on_exception = true |