Changeset 1852
- Timestamp:
- 06/18/07 22:19:18 (1 year ago)
- Files:
-
- trunk/lib/wsdl/soap/literalMappingRegistryCreator.rb (modified) (1 diff)
- trunk/test/wsdl/document/array/double.wsdl (modified) (4 diffs)
- trunk/test/wsdl/document/array/test_array.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/wsdl/soap/literalMappingRegistryCreator.rb
r1824 r1852 161 161 if child_type == XSD::AnyTypeName 162 162 type = nil 163 elsif child_element and (klass = element_basetype(child_element)) 164 type = klass.name 163 elsif child_element 164 if klass = element_basetype(child_element) 165 type = klass.name 166 else 167 type = create_class_name(child_element.name, @modulepath) 168 end 165 169 elsif child_type 166 170 type = create_class_name(child_type, @modulepath) trunk/test/wsdl/document/array/double.wsdl
r1638 r1852 33 33 </s:element> 34 34 <s:element name="ArrayOfDouble" nillable="true" type="tns:ArrayOfDouble"/> 35 36 <s:element name="echo2"> 37 <s:complexType> 38 <s:sequence> 39 <s:element name="arg" type="tns:ArrayOfComplex"/> 40 </s:sequence> 41 </s:complexType> 42 </s:element> 43 <s:element name="echo2Response"> 44 <s:complexType> 45 <s:sequence> 46 <s:element name="arg" type="tns:ArrayOfComplex"/> 47 </s:sequence> 48 </s:complexType> 49 </s:element> 50 <s:element name="ArrayOfComplex"> 51 <s:complexType> 52 <s:sequence> 53 <s:element ref="tns:Complex" maxOccurs="3"/> 54 </s:sequence> 55 </s:complexType> 56 </s:element> 57 <s:element name="Complex"> 58 <s:complexType> 59 <s:sequence> 60 <s:element name="string" type="s:string"/> 61 <s:element name="double" type="s:double"/> 62 </s:sequence> 63 </s:complexType> 64 </s:element> 35 65 </s:schema> 36 66 </wsdl:types> … … 42 72 <wsdl:part name="parameters" element="tns:echoResponse"/> 43 73 </wsdl:message> 74 <wsdl:message name="echo2In"> 75 <wsdl:part name="parameters" element="tns:echo2"/> 76 </wsdl:message> 77 <wsdl:message name="echo2Out"> 78 <wsdl:part name="parameters" element="tns:echo2Response"/> 79 </wsdl:message> 44 80 45 81 <wsdl:portType name="pricerSoap"> … … 47 83 <wsdl:input message="tns:echoIn"/> 48 84 <wsdl:output message="tns:echoOut"/> 85 </wsdl:operation> 86 87 <wsdl:operation name="echo2"> 88 <wsdl:input message="tns:echo2In"/> 89 <wsdl:output message="tns:echo2Out"/> 49 90 </wsdl:operation> 50 91 </wsdl:portType> … … 55 96 <wsdl:operation name="echo"> 56 97 <soap:operation soapAction="http://tempuri.org/echo" style="document"/> 98 <wsdl:input> 99 <soap:body use="literal"/> 100 </wsdl:input> 101 <wsdl:output> 102 <soap:body use="literal"/> 103 </wsdl:output> 104 </wsdl:operation> 105 <wsdl:operation name="echo2"> 106 <soap:operation soapAction="http://tempuri.org/echo2" style="document"/> 57 107 <wsdl:input> 58 108 <soap:body use="literal"/> trunk/test/wsdl/document/array/test_array.rb
r1794 r1852 22 22 XSD::QName.new(Namespace, 'echoResponse') 23 23 ) 24 add_document_method( 25 self, 26 Namespace + 'echo2', 27 'echo2', 28 XSD::QName.new(Namespace, 'echo2'), 29 XSD::QName.new(Namespace, 'echo2Response') 30 ) 24 31 self.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry 25 32 end 26 33 27 34 def echo(arg) 35 arg 36 end 37 38 def echo2(arg) 28 39 arg 29 40 end … … 45 56 File.unlink(pathname('double.rb')) 46 57 File.unlink(pathname('doubleMappingRegistry.rb')) 58 File.unlink(pathname('doubleDriver.rb')) 47 59 end 48 60 @client.reset_stream if @client … … 62 74 gen.opt['classdef'] = nil 63 75 gen.opt['mapping_registry'] = nil 76 gen.opt['driver'] = nil 64 77 gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') 65 78 gen.opt['force'] = true 66 79 gen.run 67 TestUtil.require(DIR, 'double MappingRegistry.rb', 'double.rb')80 TestUtil.require(DIR, 'doubleDriver.rb', 'doubleMappingRegistry.rb', 'double.rb') 68 81 end 69 82 … … 79 92 80 93 def test_stub 94 @client = PricerSoap.new 95 @client.endpoint_url = "http://localhost:#{Port}/" 96 @client.wiredump_dev = STDOUT if $DEBUG 97 arg = ArrayOfComplex[c1 = Complex.new, c2 = Complex.new, c3 = Complex.new] 98 c1.string = "str_c1" 99 c1.double = 1.1 100 c2.string = "str_c2" 101 c2.double = 2.2 102 c3.string = "str_c3" 103 c3.double = 3.3 104 ret = @client.echo2(Echo2.new(arg)) 105 assert_equal(ArrayOfComplex, ret.arg.class) 106 assert_equal(Complex, ret.arg[0].class) 107 assert_equal(arg[0].string, ret.arg[0].string) 108 assert_equal(arg[1].string, ret.arg[1].string) 109 assert_equal(arg[2].string, ret.arg[2].string) 110 end 111 112 def test_wsdl_stubclassdef 81 113 wsdl = File.join(DIR, 'double.wsdl') 82 114 @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver