Changeset 1924
- Timestamp:
- 08/26/07 22:41:31 (1 year ago)
- Files:
-
- trunk/lib/soap/mapping/literalregistry.rb (modified) (4 diffs)
- trunk/lib/soap/mapping/mapping.rb (modified) (2 diffs)
- trunk/lib/soap/mapping/schemadefinition.rb (modified) (2 diffs)
- trunk/lib/wsdl/soap/mappingRegistryCreatorSupport.rb (modified) (2 diffs)
- trunk/lib/wsdl/xmlSchema/complexType.rb (modified) (1 diff)
- trunk/lib/xsd/mapping.rb (modified) (1 diff)
- trunk/test/wsdl/choice/test_choice.rb (modified) (1 diff)
- trunk/test/wsdl/group/test_rpc.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/soap/mapping/literalregistry.rb
r1921 r1924 23 23 attr_accessor :excn_handler_obj2soap 24 24 attr_accessor :excn_handler_soap2obj 25 attr_accessor :generate_explicit_type 25 26 26 27 def initialize … … 28 29 @excn_handler_obj2soap = nil 29 30 @excn_handler_soap2obj = nil 31 @generate_explicit_type = false 30 32 end 31 33 … … 137 139 end 138 140 ele.qualified = definition.qualified 139 if definition.type 141 if definition.type and (@generate_explicit_type or definition.basetype) 140 142 ele.extraattr[XSD::AttrTypeName] = definition.type 141 143 end … … 147 149 if definition.attributes 148 150 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) 151 154 end 152 155 end trunk/lib/soap/mapping/mapping.rb
r1923 r1924 423 423 schema_name = definition[:schema_name] 424 424 schema_type = definition[:schema_type] 425 schema_basetype = definition[:schema_basetype] 425 426 # wrap if needed for backward compatibility 426 427 if schema_ns 427 428 schema_name = Mapping.to_qname(schema_name, schema_ns) if schema_name 428 429 schema_type = Mapping.to_qname(schema_type, schema_ns) if schema_type 430 # no need for schema_basetype bacause it's introduced later 429 431 end 430 432 schema_qualified = definition[:schema_qualified] … … 432 434 schema_attributes = definition[:schema_attribute] 433 435 definition = SchemaDefinition.new(klass, schema_name, schema_type, schema_qualified) 436 definition.basetype = schema_basetype 434 437 definition.attributes = schema_attributes 435 438 if schema_element trunk/lib/soap/mapping/schemadefinition.rb
r1824 r1924 142 142 attr_reader :elename, :type 143 143 attr_reader :qualified 144 attr_accessor :basetype 144 145 attr_accessor :attributes 145 146 attr_accessor :elements … … 150 151 @type = type 151 152 @qualified = qualified 153 @basetype = nil 152 154 @elements = EMPTY 153 155 @attributes = nil trunk/lib/wsdl/soap/mappingRegistryCreatorSupport.rb
r1923 r1924 37 37 else 38 38 var[:schema_type] = qname 39 var[:schema_basetype] = typedef.base if typedef.base 39 40 schema_ns = qname.namespace 40 41 end … … 213 214 dump_entry_item(var, :schema_name, :qname), 214 215 dump_entry_item(var, :schema_type, :qname), 216 dump_entry_item(var, :schema_basetype, :qname), 215 217 dump_entry_item(var, :schema_qualified), 216 218 dump_entry_item(var, :schema_element), trunk/lib/wsdl/xmlSchema/complexType.rb
r1917 r1924 60 60 else 61 61 false 62 end 63 end 64 65 def base 66 if c = @complexcontent || @simplecontent 67 c.base 62 68 end 63 69 end trunk/lib/xsd/mapping.rb
r1859 r1924 33 33 def initialize(registry) 34 34 @registry = registry 35 @registry.generate_explicit_type = true 35 36 end 36 37 trunk/test/wsdl/choice/test_choice.rb
r1897 r1924 196 196 arg = EmptyArrayAtFirst.new 197 197 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) 202 202 end 203 203 end trunk/test/wsdl/group/test_rpc.rb
r1917 r1924 13 13 class Server < ::SOAP::RPC::StandaloneServer 14 14 Namespace = 'urn:group' 15 TypeNamespace = 'urn:grouptype' 15 16 16 17 def on_init … … 19 20 Namespace + ':echo', 20 21 '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') 23 24 ) 24 25 self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry … … 107 108 @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") 108 109 @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')) 111 112 @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry 112 113 @client.wiredump_dev = STDOUT if $DEBUG