Changeset 1445
- Timestamp:
- 02/11/05 12:57:26 (4 years ago)
- Files:
-
- trunk/lib/soap/wsdlDriver.rb (modified) (4 diffs)
- trunk/lib/wsdl/soap/cgiStubCreator.rb (modified) (3 diffs)
- trunk/lib/wsdl/soap/classDefCreator.rb (modified) (2 diffs)
- trunk/lib/wsdl/soap/classDefCreatorSupport.rb (modified) (1 diff)
- trunk/lib/wsdl/soap/driverCreator.rb (modified) (2 diffs)
- trunk/lib/wsdl/soap/mappingRegistryCreator.rb (modified) (5 diffs)
- trunk/lib/wsdl/soap/servantSkeltonCreator.rb (modified) (4 diffs)
- trunk/lib/wsdl/soap/standaloneServerStubCreator.rb (modified) (3 diffs)
- trunk/lib/wsdl/xmlSchema/simpleContent.rb (modified) (1 diff)
- trunk/lib/wsdl/xmlSchema/simpleType.rb (modified) (2 diffs)
- trunk/lib/xsd/xmlparser/xmlscanner.rb (modified) (2 diffs)
- trunk/test/soap/wsdlDriver/test_simpletype.rb (modified) (1 diff)
- trunk/test/wsdl/any/expectedDriver.rb (modified) (2 diffs)
- trunk/test/wsdl/any/expectedService.rb (modified) (1 diff)
- trunk/test/wsdl/simpletype/rpc/expectedDriver.rb (modified) (2 diffs)
- trunk/test/wsdl/simpletype/rpc/expectedService.rb (modified) (1 diff)
- trunk/test/wsdl/soap/wsdl2ruby/expectedDriver.rb (modified) (2 diffs)
- trunk/test/wsdl/soap/wsdl2ruby/expectedService.cgi (modified) (1 diff)
- trunk/test/wsdl/soap/wsdl2ruby/expectedService.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/soap/wsdlDriver.rb
r1438 r1445 95 95 soapaction = op_bind.soapoperation ? op_bind.soapoperation.soapaction : '' 96 96 orgname = op.name.name 97 name = ::XSD::CodeGen::GenSupport.safemethodname(orgname)97 name = XSD::CodeGen::GenSupport.safemethodname(orgname) 98 98 param_def = create_param_def(op_bind) 99 99 opt = {} … … 447 447 header = SOAPHeader.new() 448 448 op_info.headerparts.each do |part| 449 child = Mapping. find_attribute(obj, part.name)449 child = Mapping.get_attribute(obj, part.name) 450 450 ele = headeritem_from_obj(child, part.element || part.eletype) 451 451 header.add(part.name, ele) … … 481 481 body = SOAPBody.new 482 482 op_info.bodyparts.each do |part| 483 child = Mapping. find_attribute(obj, part.name)483 child = Mapping.get_attribute(obj, part.name) 484 484 ele = bodyitem_from_obj(child, part.element || part.type) 485 485 body.add(ele.elename.name, ele) … … 500 500 501 501 def add_method_interface(op_info) 502 name = ::XSD::CodeGen::GenSupport.safemethodname(op_info.op_name.name)502 name = XSD::CodeGen::GenSupport.safemethodname(op_info.op_name.name) 503 503 orgname = op_info.op_name.name 504 504 parts_names = op_info.bodyparts.collect { |part| part.name } trunk/lib/wsdl/soap/cgiStubCreator.rb
r1399 r1445 1 1 # WSDL4R - Creating CGI stub code from WSDL. 2 # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 40 40 methoddef, types = MethodDefCreator.new(@definitions).dump(name) 41 41 mr_creator = MappingRegistryCreator.new(@definitions) 42 c1 = ::XSD::CodeGen::ClassDef.new(class_name)42 c1 = XSD::CodeGen::ClassDef.new(class_name) 43 43 c1.def_require("soap/rpc/cgistub") 44 44 c1.def_require("soap/mapping/registry") … … 47 47 c1.def_code <<-EOD 48 48 Methods = [ 49 #{ methoddef.gsub(/^/, " ")}49 #{methoddef.gsub(/^/, " ")} 50 50 ] 51 51 EOD 52 c2 = ::XSD::CodeGen::ClassDef.new(class_name + "App",52 c2 = XSD::CodeGen::ClassDef.new(class_name + "App", 53 53 "::SOAP::RPC::CGIStub") 54 54 c2.def_method("initialize", "*arg") do trunk/lib/wsdl/soap/classDefCreator.rb
r1442 r1445 154 154 params << "#{varname} = nil" 155 155 end 156 schema_element << [name, type] 156 qname = (varname == name) ? nil : element.name 157 schema_element << [varname, qname, type] 157 158 end 158 159 unless typedef.attributes.empty? … … 162 163 c.def_classvar('schema_element', 163 164 '{' + 164 schema_element.collect { |name, type| 165 name.dump + ' => ' + ndq(type) 165 schema_element.collect { |varname, name, type| 166 if name 167 varname.dump + ' => [' + ndq(type) + ', ' + dqname(name) + ']' 168 else 169 varname.dump + ' => ' + ndq(type) 170 end 166 171 }.join(', ') + 167 172 '}' trunk/lib/wsdl/soap/classDefCreatorSupport.rb
r1426 r1445 72 72 end 73 73 74 def dqname(qname) 75 "XSD::QName.new(#{ndq(qname.namespace)}, #{ndq(qname.name)})" 76 end 77 74 78 private 75 79 trunk/lib/wsdl/soap/driverCreator.rb
r1418 r1445 50 50 addresses = @definitions.porttype(name).locations 51 51 52 c = ::XSD::CodeGen::ClassDef.new(class_name, "::SOAP::RPC::Driver")52 c = XSD::CodeGen::ClassDef.new(class_name, "::SOAP::RPC::Driver") 53 53 c.def_require("soap/rpc/driver") 54 54 c.def_const("MappingRegistry", "::SOAP::Mapping::Registry.new") … … 71 71 <<-EOD 72 72 Methods.each do |name_as, name, params, soapaction, namespace, style| 73 qname = ::XSD::QName.new(namespace, name_as)73 qname = XSD::QName.new(namespace, name_as) 74 74 if style == :document 75 75 @proxy.add_document_method(soapaction, name, params) trunk/lib/wsdl/soap/mappingRegistryCreator.rb
r1245 r1445 1 1 # WSDL4R - Creating MappingRegistry code from WSDL. 2 # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 39 39 end 40 40 end 41 end41 end 42 42 return map 43 43 end … … 53 53 dump_array_typemap(definedtype) 54 54 else 55 raise NotImplementedError.new(" Must not reach here.")55 raise NotImplementedError.new("must not reach here") 56 56 end 57 57 end … … 62 62 return <<__EOD__ 63 63 MappingRegistry.set( 64 #{ create_class_name(ele)},64 #{create_class_name(ele)}, 65 65 ::SOAP::SOAPStruct, 66 66 ::SOAP::Mapping::Registry::TypedStructFactory, 67 { :type => ::XSD::QName.new("#{ ele.namespace }", "#{ ele.name }")}67 { :type => #{dqname(ele)} } 68 68 ) 69 69 __EOD__ … … 77 77 return <<__EOD__ 78 78 MappingRegistry.set( 79 #{ create_class_name(ele)},79 #{create_class_name(ele)}, 80 80 ::SOAP::SOAPArray, 81 81 ::SOAP::Mapping::Registry::TypedArrayFactory, 82 { :type => ::XSD::QName.new("#{ type.namespace }", "#{ type.name }")}82 { :type => #{dqname(type)} } 83 83 ) 84 84 __EOD__ trunk/lib/wsdl/soap/servantSkeltonCreator.rb
r1287 r1445 1 1 # WSDL4R - Creating servant skelton code from WSDL. 2 # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 18 18 class ServantSkeltonCreator 19 19 include ClassDefCreatorSupport 20 include ::XSD::CodeGen::GenSupport20 include XSD::CodeGen::GenSupport 21 21 22 22 attr_reader :definitions … … 43 43 def dump_porttype(name) 44 44 class_name = create_class_name(name) 45 c = ::XSD::CodeGen::ClassDef.new(class_name)45 c = XSD::CodeGen::ClassDef.new(class_name) 46 46 operations = @definitions.porttype(name).operations 47 47 operations.each do |operation| … … 51 51 safevarname(part.name) 52 52 } 53 m = ::XSD::CodeGen::MethodDef.new(name, params) do <<-EOD53 m = XSD::CodeGen::MethodDef.new(name, params) do <<-EOD 54 54 p [#{params.join(", ")}] 55 55 raise NotImplementedError.new trunk/lib/wsdl/soap/standaloneServerStubCreator.rb
r1399 r1445 1 1 # WSDL4R - Creating standalone server stub code from WSDL. 2 # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 42 42 mr_creator = MappingRegistryCreator.new(@definitions) 43 43 44 c1 = ::XSD::CodeGen::ClassDef.new(class_name)44 c1 = XSD::CodeGen::ClassDef.new(class_name) 45 45 c1.def_require("soap/rpc/standaloneServer") 46 46 c1.def_require("soap/mapping/registry") … … 49 49 c1.def_code <<-EOD 50 50 Methods = [ 51 #{ methoddef.gsub(/^/, " ")}51 #{methoddef.gsub(/^/, " ")} 52 52 ] 53 53 EOD 54 c2 = ::XSD::CodeGen::ClassDef.new(class_name + "App",54 c2 = XSD::CodeGen::ClassDef.new(class_name + "App", 55 55 "::SOAP::RPC::StandaloneServer") 56 56 c2.def_method("initialize", "*arg") do trunk/lib/wsdl/xmlSchema/simpleContent.rb
r1439 r1445 56 56 def check(value) 57 57 unless content.valid?(value) 58 raise ::XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'")58 raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'") 59 59 end 60 60 end trunk/lib/wsdl/xmlSchema/simpleType.rb
r1440 r1445 1 1 # WSDL4R - XMLSchema simpleType definition for WSDL. 2 # Copyright (C) 2004 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2004, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 64 64 def check_restriction(value) 65 65 unless @restriction.valid?(value) 66 raise ::XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'.")66 raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'") 67 67 end 68 68 end trunk/lib/xsd/xmlparser/xmlscanner.rb
r1058 r1445 1 1 # XSD4R - XMLScan XML parser library. 2 # Copyright (C) 2002, 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2002, 2003, 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 22 22 @curattr = nil 23 23 @scanner = XMLScan::XMLScanner.new(self) 24 @scanner.kcode = ::XSD::Charset.charset_str(charset) if charset24 @scanner.kcode = XSD::Charset.charset_str(charset) if charset 25 25 @scanner.parse(string_or_readable) 26 26 end 27 27 28 28 def scanner_kcode=(charset) 29 @scanner.kcode = ::XSD::Charset.charset_str(charset) if charset29 @scanner.kcode = XSD::Charset.charset_str(charset) if charset 30 30 self.xmldecl_encoding = charset 31 31 end trunk/test/soap/wsdlDriver/test_simpletype.rb
r1415 r1445 74 74 assert_equal("1.9", result.version) 75 75 assert_equal("checked", result.msg) 76 assert_raise( ::XSD::ValueSpaceError) do76 assert_raise(XSD::ValueSpaceError) do 77 77 @client.echo_version("2.0") 78 78 end 79 assert_raise( ::XSD::ValueSpaceError) do79 assert_raise(XSD::ValueSpaceError) do 80 80 @client.echo_version(nil) # nil => "2.0" => out of range 81 81 end trunk/test/wsdl/any/expectedDriver.rb
r1424 r1445 11 11 ::SOAP::SOAPStruct, 12 12 ::SOAP::Mapping::Registry::TypedStructFactory, 13 { :type => ::XSD::QName.new("urn:example.com:echo-type", "foo.bar") }13 { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") } 14 14 ) 15 15 … … 35 35 def init_methods 36 36 Methods.each do |name_as, name, params, soapaction, namespace, style| 37 qname = ::XSD::QName.new(namespace, name_as)37 qname = XSD::QName.new(namespace, name_as) 38 38 if style == :document 39 39 @proxy.add_document_method(soapaction, name, params) trunk/test/wsdl/any/expectedService.rb
r1399 r1445 12 12 ::SOAP::SOAPStruct, 13 13 ::SOAP::Mapping::Registry::TypedStructFactory, 14 { :type => ::XSD::QName.new("urn:example.com:echo-type", "foo.bar") }14 { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") } 15 15 ) 16 16 trunk/test/wsdl/simpletype/rpc/expectedDriver.rb
r1424 r1445 11 11 ::SOAP::SOAPStruct, 12 12 ::SOAP::Mapping::Registry::TypedStructFactory, 13 { :type => ::XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }13 { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") } 14 14 ) 15 15 … … 42 42 def init_methods 43 43 Methods.each do |name_as, name, params, soapaction, namespace, style| 44 qname = ::XSD::QName.new(namespace, name_as)44 qname = XSD::QName.new(namespace, name_as) 45 45 if style == :document 46 46 @proxy.add_document_method(soapaction, name, params) trunk/test/wsdl/simpletype/rpc/expectedService.rb
r1399 r1445 12 12 ::SOAP::SOAPStruct, 13 13 ::SOAP::Mapping::Registry::TypedStructFactory, 14 { :type => ::XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }14 { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") } 15 15 ) 16 16 trunk/test/wsdl/soap/wsdl2ruby/expectedDriver.rb
r1424 r1445 11 11 ::SOAP::SOAPStruct, 12 12 ::SOAP::Mapping::Registry::TypedStructFactory, 13 { :type => ::XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }13 { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") } 14 14 ) 15 15 … … 42 42 def init_methods 43 43 Methods.each do |name_as, name, params, soapaction, namespace, style| 44 qname = ::XSD::QName.new(namespace, name_as)44 qname = XSD::QName.new(namespace, name_as) 45 45 if style == :document 46 46 @proxy.add_document_method(soapaction, name, params) trunk/test/wsdl/soap/wsdl2ruby/expectedService.cgi
r1399 r1445 12 12 ::SOAP::SOAPStruct, 13 13 ::SOAP::Mapping::Registry::TypedStructFactory, 14 { :type => ::XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }14 { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") } 15 15 ) 16 16 trunk/test/wsdl/soap/wsdl2ruby/expectedService.rb
r1399 r1445 12 12 ::SOAP::SOAPStruct, 13 13 ::SOAP::Mapping::Registry::TypedStructFactory, 14 { :type => ::XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }14 { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") } 15 15 ) 16 16