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 /lib/soap | |
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 'lib/soap')
-rw-r--r-- | lib/soap/encodingstyle/soapHandler.rb | 10 | ||||
-rw-r--r-- | lib/soap/mapping/factory.rb | 15 | ||||
-rw-r--r-- | lib/soap/mapping/mapping.rb | 3 | ||||
-rw-r--r-- | lib/soap/mapping/registry.rb | 26 | ||||
-rw-r--r-- | lib/soap/streamHandler.rb | 6 |
5 files changed, 27 insertions, 33 deletions
diff --git a/lib/soap/encodingstyle/soapHandler.rb b/lib/soap/encodingstyle/soapHandler.rb index 51780f5520..1f359bef4e 100644 --- a/lib/soap/encodingstyle/soapHandler.rb +++ b/lib/soap/encodingstyle/soapHandler.rb @@ -162,8 +162,6 @@ class SOAPHandler < Handler o = SOAPReference.decode(elename, href) @refpool << o elsif @decode_typemap - # to parse multi-ref element with decode_tag_by_type. - # && (parent.node.class != SOAPBody || @is_first_top_ele) o = decode_tag_by_wsdl(ns, elename, type, parent.node, arytype, extraattr) else o = decode_tag_by_type(ns, elename, type, parent.node, arytype, extraattr) @@ -333,6 +331,7 @@ private def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr) o = nil + # should branch by root attribute? if parent.class == SOAPBody if @is_first_top_ele # Unqualified name is allowed here. @@ -363,11 +362,12 @@ private extraattr) end - # parent.definedtype is nil means the parent is SOAPUnknown. SOAPUnknown is - # generated by decode_tag_by_type when its type is anyType. + # parent.definedtype == nil means the parent is SOAPUnknown. SOAPUnknown + # is generated by decode_tag_by_type when its type is anyType. parenttype = parent.definedtype || @decode_typemap[parent.type] unless parenttype - raise EncodingStyleError.new("Unknown type '#{ parent.type }'.") + return decode_tag_by_type(ns, elename, typestr, parent, arytypestr, + extraattr) end definedtype_name = parenttype.child_type(elename) diff --git a/lib/soap/mapping/factory.rb b/lib/soap/mapping/factory.rb index 509fe369c4..f181773687 100644 --- a/lib/soap/mapping/factory.rb +++ b/lib/soap/mapping/factory.rb @@ -356,14 +356,21 @@ class HashFactory_ < Factory unless node.type == MapQName return false end - if node.key?('default') + if node.class == SOAPStruct and node.key?('default') return false end obj = create_empty_object(obj_class) mark_unmarshalled_obj(node, obj) - node.each do |key, value| - obj[Mapping._soap2obj(value['key'], map)] = - Mapping._soap2obj(value['value'], map) + if node.class == SOAPStruct + node.each do |key, value| + obj[Mapping._soap2obj(value['key'], map)] = + Mapping._soap2obj(value['value'], map) + end + else + node.each do |value| + obj[Mapping._soap2obj(value['key'], map)] = + Mapping._soap2obj(value['value'], map) + end end return true, obj end diff --git a/lib/soap/mapping/mapping.rb b/lib/soap/mapping/mapping.rb index 32be9839c8..4b68b811fc 100644 --- a/lib/soap/mapping/mapping.rb +++ b/lib/soap/mapping/mapping.rb @@ -77,9 +77,10 @@ module Mapping end if detail.is_a?(Mapping::SOAPException) begin + remote_backtrace = detail.to_e.backtrace raise detail.to_e rescue Exception => e2 - detail.set_backtrace(e2) + e2.set_backtrace(remote_backtrace + e2.backtrace) raise end else diff --git a/lib/soap/mapping/registry.rb b/lib/soap/mapping/registry.rb index 51ad939d99..46a04e368f 100644 --- a/lib/soap/mapping/registry.rb +++ b/lib/soap/mapping/registry.rb @@ -34,11 +34,9 @@ RubyIVarName = XSD::QName.new(RubyTypeInstanceNamespace, 'ivars') # Inner class to pass an exception. class SOAPException; include Marshallable - attr_reader :excn_type_name, :message, :backtrace, :cause + attr_reader :excn_type_name, :cause def initialize(e) @excn_type_name = Mapping.name2elename(e.class.to_s) - @message = e.message - @backtrace = e.backtrace @cause = e end @@ -50,25 +48,15 @@ class SOAPException; include Marshallable klass = Mapping.class_from_name( Mapping.elename2name(@excn_type_name.to_s)) if klass.nil? - raise RuntimeError.new(@message) + raise RuntimeError.new(@cause.message) end unless klass <= ::Exception raise NameError.new end - obj = klass.new(@message) + obj = klass.new(@cause.message) obj.extend(::SOAP::Mapping::MappedException) obj end - - def set_backtrace(e) - e.set_backtrace( - if @backtrace.is_a?(Array) - @backtrace - else - [@backtrace.inspect] - end - ) - end end @@ -238,10 +226,12 @@ class Registry [::String, ::SOAP::SOAPGMonth, BasetypeFactory], [::String, ::SOAP::SOAPQName, BasetypeFactory], + [::Hash, ::SOAP::SOAPArray, HashFactory], + [::Hash, ::SOAP::SOAPStruct, HashFactory], + [::Array, ::SOAP::SOAPArray, ArrayFactory, {:derived_class => true}], - [::Hash, ::SOAP::SOAPStruct, HashFactory], [::SOAP::Mapping::SOAPException, ::SOAP::SOAPStruct, TypedStructFactory, {:type => XSD::QName.new(RubyCustomTypeNamespace, "SOAPException")}], @@ -282,10 +272,12 @@ class Registry [::String, ::SOAP::SOAPGMonth, BasetypeFactory], [::String, ::SOAP::SOAPQName, BasetypeFactory], + [::Hash, ::SOAP::SOAPArray, HashFactory], + [::Hash, ::SOAP::SOAPStruct, HashFactory], + # Does not allow Array's subclass here. [::Array, ::SOAP::SOAPArray, ArrayFactory], - [::Hash, ::SOAP::SOAPStruct, HashFactory], [::SOAP::Mapping::SOAPException, ::SOAP::SOAPStruct, TypedStructFactory, {:type => XSD::QName.new(RubyCustomTypeNamespace, "SOAPException")}], diff --git a/lib/soap/streamHandler.rb b/lib/soap/streamHandler.rb index 7dcb2d62d6..c5c0661455 100644 --- a/lib/soap/streamHandler.rb +++ b/lib/soap/streamHandler.rb @@ -82,9 +82,6 @@ public attr_reader :client NofRetry = 10 # [times] - ConnectTimeout = 20 # [sec] - SendTimeout = 60 # [sec] - ReceiveTimeout = 60 # [sec] def initialize(endpoint_url, proxy = nil, charset = nil) super(endpoint_url) @@ -93,9 +90,6 @@ public @wiredump_dev = nil # Set an IO to get wiredump. @wiredump_file_base = nil @client = Client.new(@proxy, "SOAP4R/#{ Version }") - @client.session_manager.connect_timeout = ConnectTimeout - @client.session_manager.send_timeout = SendTimeout - @client.session_manager.receive_timeout = ReceiveTimeout end def inspect |