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

Changeset 1835

Show
Ignore:
Timestamp:
06/06/07 15:15:43 (1 year ago)
Author:
nahi
Message:
  • abstract type embedded in another type was not propertly unmarshalled with the LiteralRegistry? which is generated by wsdl2ruby.rb. closes #356.
Files:

Legend:

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

    r1830 r1835  
    188188 
    189189  def any2obj(node, obj_class = nil) 
     190    is_compound = node.is_a?(::SOAP::SOAPCompoundtype) 
     191    # trust xsi:type first 
     192    if is_compound and node.type 
     193      definition = schema_definition_from_type(node.type) 
     194    end 
     195    # element name next 
     196    definition ||= schema_definition_from_elename(node.elename) 
     197    # class defined in parent type last 
    190198    if obj_class 
    191       definition = schema_definition_from_class(obj_class) 
    192     else 
    193       if node.is_a?(::SOAP::SOAPStruct) 
    194         definition = find_node_definition(node) 
    195       else 
    196         definition = schema_definition_from_elename(node.elename) 
    197       end 
    198       if definition 
    199         obj_class = definition.class_for 
    200       end 
    201     end 
    202     if node.is_a?(::SOAP::SOAPElement) or node.is_a?(::SOAP::SOAPStruct) 
     199      definition ||= schema_definition_from_class(obj_class) 
     200    end 
     201    if definition 
     202      obj_class = definition.class_for 
     203    end 
     204    if is_compound 
    203205      if definition 
    204206        return elesoap2stubobj(node, obj_class, definition) 
  • trunk/test/wsdl/abstract/test_abstract.rb

    r1830 r1835  
    141141    assert_equal(author.lastname, ret.lastname) 
    142142    assert_equal(author.nonuserid, ret.nonuserid) 
     143    assert_equal(NonUserAuthor, ret.class) 
    143144  end 
    144145