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

Changeset 1809

Show
Ignore:
Timestamp:
05/25/07 16:43:11 (2 years ago)
Author:
nahi
Message:
  • ref + min/macOccurs did not work (min/maxOccurs attribute in 'ref'-side element was ignored.) closes #344.
  • let Element#min/maxOccurs keep an Integer, not a String. nil for 'unbounded'.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/mapping/wsdlliteralregistry.rb

    r1788 r1809  
    222222    if ele.nillable 
    223223      obj2elesoap(nil, ele)     # add an empty element 
    224     elsif Integer(ele.minoccurs) == 0 
     224    elsif ele.minoccurs == 0 
    225225      nil       # intends no element 
    226226    else 
  • trunk/lib/wsdl/soap/complexType.rb

    r1759 r1809  
    2525    elsif content 
    2626      e = elements 
    27       if attributes.empty? and e.size == 1 and e[0].maxoccurs != '1' 
     27      if attributes.empty? and e.size == 1 and e[0].map_as_array? 
    2828        if name == ::SOAP::Mapping::MapQName 
    2929          :TYPE_MAP 
     
    146146  def check_array_content 
    147147    e = elements 
    148     e.size == 1 and e[0].maxoccurs != '1' 
    149     # content and content.elements.size == 1 and 
    150     #   content.elements[0].maxoccurs != '1' 
     148    e.size == 1 and e[0].map_as_array? 
    151149  end 
    152150 
  • trunk/lib/wsdl/soap/element.rb

    r1520 r1809  
    1616class Element < Info 
    1717  def map_as_array? 
    18     maxoccurs != '1' 
     18    maxoccurs.nil? or maxoccurs != 1 
    1919  end 
    2020 
  • trunk/lib/wsdl/xmlSchema/any.rb

    r1520 r1809  
    2222  def initialize 
    2323    super() 
    24     @maxoccurs = '1' 
    25     @minoccurs = '1' 
     24    @maxoccurs = 1 
     25    @minoccurs = 1 
    2626    @namespace = '##any' 
    2727    @process_contents = 'strict' 
     
    3939    case attr 
    4040    when MaxOccursAttrName 
    41       @maxoccurs = value.source 
     41      if value.source == 'unbounded' 
     42        @maxoccurs = nil 
     43      else 
     44        @maxoccurs = Integer(value.source) 
     45      end 
     46      value.source 
    4247    when MinOccursAttrName 
    43       @minoccurs = value.source 
     48      @minoccurs = Integer(value.source) 
    4449    when NamespaceAttrName 
    4550      @namespace = value.source 
  • trunk/lib/wsdl/xmlSchema/content.rb

    r1759 r1809  
    2121  def initialize 
    2222    super() 
    23     @minoccurs = '1' 
    24     @maxoccurs = '1' 
     23    @minoccurs = 1 
     24    @maxoccurs = 1 
    2525    @elements = XSD::NamedElements.new 
    2626  end 
     
    7373    case attr 
    7474    when MaxOccursAttrName 
    75       @maxoccurs = value.source 
     75      if value.source == 'unbounded' 
     76        @maxoccurs = nil 
     77      else 
     78        @maxoccurs = Integer(value.source) 
     79      end 
     80      value.source 
    7681    when MinOccursAttrName 
    77       @minoccurs = value.source 
     82      @minoccurs = Integer(value.source) 
    7883    else 
    7984      nil 
  • trunk/lib/wsdl/xmlSchema/element.rb

    r1724 r1809  
    4242  attr_writer :local_complextype 
    4343  attr_writer :constraint 
    44   attr_writer :maxoccurs 
    45   attr_writer :minoccurs 
     44  attr_accessor :maxoccurs 
     45  attr_accessor :minoccurs 
    4646  attr_writer :nillable 
    4747 
     
    5252  attr_reader_ref :local_complextype 
    5353  attr_reader_ref :constraint 
    54   attr_reader_ref :maxoccurs 
    55   attr_reader_ref :minoccurs 
    5654  attr_reader_ref :nillable 
    5755 
     
    6563    @local_simpletype = @local_complextype = nil 
    6664    @constraint = nil 
    67     @maxoccurs = '1' 
    68     @minoccurs = '1' 
     65    @maxoccurs = 1 
     66    @minoccurs = 1 
    6967    @nillable = nil 
    7068    @ref = nil 
     
    131129        end 
    132130      end 
    133       @maxoccurs = value.source 
     131      if value.source == 'unbounded' 
     132        @maxoccurs = nil 
     133      else 
     134        @maxoccurs = Integer(value.source) 
     135      end 
     136      value.source 
    134137    when MinOccursAttrName 
    135138      if parent.is_a?(All) 
     
    139142        end 
    140143      end 
    141       @minoccurs = value.source 
     144      @minoccurs = Integer(value.source) 
    142145    when NillableAttrName 
    143146      @nillable = (value.source == 'true') 
  • trunk/test/wsdl/rpc/test-rpc-lit.wsdl

    r1713 r1809  
    4040      </complexType> 
    4141 
     42      <complexType name="CombinationArray"> 
     43        <sequence> 
     44          <element name="a" type="xsd:string" minOccurs="0" maxOccurs="unbounded" /> 
     45          <element name="b" type="xsd:int" minOccurs="0" maxOccurs="unbounded" /> 
     46        </sequence> 
     47      </complexType> 
     48 
    4249      <complexType name="ArrayOfSOAPStruct"> 
    4350        <sequence>