Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1044

Show
Ignore:
Timestamp:
11/13/03 23:52:41 (5 years ago)
Author:
nahi
Message:

Support WSDL array definition with maxOccures="unbound".

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/wsdl/soap/complexType.rb

    r934 r1044  
    3232  def check_type 
    3333    if content 
    34       :TYPE_STRUCT 
     34      if content.elements.size == 1 and content.elements[0].maxoccurs != 1 
     35        :TYPE_ARRAY 
     36      else 
     37        :TYPE_STRUCT 
     38      end 
    3539    elsif complexcontent and complexcontent.base == ::SOAP::ValueArrayName 
    3640      :TYPE_ARRAY 
     
    7175 
    7276  def find_arytype 
    73     complexcontent.attributes.each do |attribute| 
    74       if attribute.ref == ::SOAP::AttrArrayTypeName 
    75         return attribute.arytype 
     77    unless compoundtype == :TYPE_ARRAY 
     78      raise RuntimeError.new("Assert: not for array") 
     79    end 
     80    if complexcontent 
     81      complexcontent.attributes.each do |attribute| 
     82        if attribute.ref == ::SOAP::AttrArrayTypeName 
     83          return attribute.arytype 
     84        end 
    7685      end 
     86    elsif content.elements.size == 1 and content.elements[0].maxoccurs != 1 
     87      return content.elements[0].type 
     88    else 
     89      raise RuntimeError.new("Assert: Unknown array definition.") 
    7790    end 
    7891    nil 
     
    8295 
    8396  def content_arytype 
    84     unless compoundtype == :TYPE_ARRAY 
    85       raise RuntimeError.new("Assert: not for array") 
    86     end 
    8797    arytype = find_arytype 
    8898    ns = arytype.namespace