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

Changeset 1924

Show
Ignore:
Timestamp:
08/26/07 22:41:31 (1 year ago)
Author:
nahi
Message:
  • do not dump xsd:type for non-polymorphic type of literal service. there's an implementation which only allows xsd:type for polymorphic type hint. closes #405.
Files:

Legend:

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

    r1921 r1924  
    2323  attr_accessor :excn_handler_obj2soap 
    2424  attr_accessor :excn_handler_soap2obj 
     25  attr_accessor :generate_explicit_type 
    2526 
    2627  def initialize 
     
    2829    @excn_handler_obj2soap = nil 
    2930    @excn_handler_soap2obj = nil 
     31    @generate_explicit_type = false 
    3032  end 
    3133 
     
    137139    end 
    138140    ele.qualified = definition.qualified 
    139     if definition.type 
     141    if definition.type and (@generate_explicit_type or definition.basetype) 
    140142      ele.extraattr[XSD::AttrTypeName] = definition.type 
    141143    end 
     
    147149    if definition.attributes 
    148150      definition.attributes.each do |qname, param| 
    149         at = Mapping.get_attribute(obj, XSD::CodeGen::GenSupport.safemethodname('xmlattr_' + qname.name)) 
    150         ele.extraattr[qname] = at 
     151        attrname = XSD::CodeGen::GenSupport.safemethodname( 
     152          'xmlattr_' + qname.name) 
     153        ele.extraattr[qname] = Mapping.get_attribute(obj, attrname) 
    151154      end 
    152155    end 
  • trunk/lib/soap/mapping/mapping.rb

    r1923 r1924  
    423423    schema_name = definition[:schema_name] 
    424424    schema_type = definition[:schema_type] 
     425    schema_basetype = definition[:schema_basetype] 
    425426    # wrap if needed for backward compatibility 
    426427    if schema_ns 
    427428      schema_name = Mapping.to_qname(schema_name, schema_ns) if schema_name 
    428429      schema_type = Mapping.to_qname(schema_type, schema_ns) if schema_type 
     430      # no need for schema_basetype bacause it's introduced later 
    429431    end 
    430432    schema_qualified = definition[:schema_qualified] 
     
    432434    schema_attributes = definition[:schema_attribute] 
    433435    definition = SchemaDefinition.new(klass, schema_name, schema_type, schema_qualified) 
     436    definition.basetype = schema_basetype 
    434437    definition.attributes = schema_attributes 
    435438    if schema_element 
  • trunk/lib/soap/mapping/schemadefinition.rb

    r1824 r1924  
    142142  attr_reader :elename, :type 
    143143  attr_reader :qualified 
     144  attr_accessor :basetype 
    144145  attr_accessor :attributes 
    145146  attr_accessor :elements 
     
    150151    @type = type 
    151152    @qualified = qualified 
     153    @basetype = nil 
    152154    @elements = EMPTY 
    153155    @attributes = nil 
  • trunk/lib/wsdl/soap/mappingRegistryCreatorSupport.rb

    r1923 r1924  
    3737    else 
    3838      var[:schema_type] = qname 
     39      var[:schema_basetype] = typedef.base if typedef.base 
    3940      schema_ns = qname.namespace 
    4041    end 
     
    213214        dump_entry_item(var, :schema_name, :qname), 
    214215        dump_entry_item(var, :schema_type, :qname), 
     216        dump_entry_item(var, :schema_basetype, :qname), 
    215217        dump_entry_item(var, :schema_qualified), 
    216218        dump_entry_item(var, :schema_element), 
  • trunk/lib/wsdl/xmlSchema/complexType.rb

    r1917 r1924  
    6060    else 
    6161      false 
     62    end 
     63  end 
     64 
     65  def base 
     66    if c = @complexcontent || @simplecontent 
     67      c.base 
    6268    end 
    6369  end 
  • trunk/lib/xsd/mapping.rb

    r1859 r1924  
    3333    def initialize(registry) 
    3434      @registry = registry 
     35      @registry.generate_explicit_type = true 
    3536    end 
    3637 
  • trunk/test/wsdl/choice/test_choice.rb

    r1897 r1924  
    196196    arg = EmptyArrayAtFirst.new 
    197197    arg.b1 = "b1" 
    198     ret = @client.echo_complex_emptyArrayAtFirst(arg
    199     assert_nil(ret.a) 
    200     assert_equal("b1", ret.b1) 
    201     assert_nil(ret.b2) 
     198    ret = @client.echo_complex_emptyArrayAtFirst(Echoele_complex_emptyArrayAtFirst.new(arg)
     199    assert_nil(ret.data.a) 
     200    assert_equal("b1", ret.data.b1) 
     201    assert_nil(ret.data.b2) 
    202202  end 
    203203end 
  • trunk/test/wsdl/group/test_rpc.rb

    r1917 r1924  
    1313  class Server < ::SOAP::RPC::StandaloneServer 
    1414    Namespace = 'urn:group' 
     15    TypeNamespace = 'urn:grouptype' 
    1516 
    1617    def on_init 
     
    1920        Namespace + ':echo', 
    2021        'echo', 
    21         XSD::QName.new(Namespace, 'groupele'), 
    22         XSD::QName.new(Namespace, 'groupele') 
     22        XSD::QName.new(TypeNamespace, 'groupele'), 
     23        XSD::QName.new(TypeNamespace, 'groupele') 
    2324      ) 
    2425      self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry 
     
    107108    @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") 
    108109    @client.add_document_method('echo', 'urn:group:echo', 
    109       XSD::QName.new('urn:group', 'groupele'), 
    110       XSD::QName.new('urn:group', 'groupele')) 
     110      XSD::QName.new('urn:grouptype', 'groupele'), 
     111      XSD::QName.new('urn:grouptype', 'groupele')) 
    111112    @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry 
    112113    @client.wiredump_dev = STDOUT if $DEBUG