From 42bca643c3ec41782d519c7676383f8f71e67a7a Mon Sep 17 00:00:00 2001 From: nahi Date: Fri, 28 Nov 2003 05:53:16 +0000 Subject: * 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 --- lib/wsdl/soap/complexType.rb | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'lib/wsdl') diff --git a/lib/wsdl/soap/complexType.rb b/lib/wsdl/soap/complexType.rb index e9818faa9a..34fc18f1a4 100644 --- a/lib/wsdl/soap/complexType.rb +++ b/lib/wsdl/soap/complexType.rb @@ -48,13 +48,22 @@ class ComplexType < Info end def child_defined_complextype(name) - unless compoundtype == :TYPE_STRUCT - raise RuntimeError.new("Assert: not for struct") - end - unless ele = find_element(name) - if name.namespace.nil? - ele = find_element_by_name(name.name) + ele = nil + case compoundtype + when :TYPE_STRUCT + unless ele = find_element(name) + if name.namespace.nil? + ele = find_element_by_name(name.name) + end end + when :TYPE_ARRAY + if content.elements.size == 1 + ele = content.elements[0] + else + raise RuntimeError.new("Assert: must not reach.") + end + else + raise RuntimeError.new("Assert: Not implemented.") end unless ele raise RuntimeError.new("Cannot find #{name} as a children of #{@name}.") @@ -83,10 +92,13 @@ class ComplexType < Info private def content_arytype - arytype = find_arytype - ns = arytype.namespace - name = arytype.name.sub(/\[(?:,)*\]$/, '') - XSD::QName.new(ns, name) + if arytype = find_arytype + ns = arytype.namespace + name = arytype.name.sub(/\[(?:,)*\]$/, '') + XSD::QName.new(ns, name) + else + nil + end end end -- cgit v1.2.3