Changeset 1950
- Timestamp:
- 09/11/07 17:53:47 (1 year ago)
- Files:
-
- trunk/test/wsdl/document/array/double.wsdl (modified) (10 diffs)
- trunk/test/wsdl/document/array/test_array.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/wsdl/document/array/double.wsdl
r1913 r1950 8 8 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 9 9 <wsdl:types> 10 <s:schema elementFormDefault="qualified" 11 targetNamespace="http://tempuri.org/"> 10 <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> 11 12 <s:element name="ArrayOfRecord"> 13 <s:complexType> 14 <s:sequence> 15 <s:element maxOccurs="unbounded" name="record" type="tns:report-record"/> 16 </s:sequence> 17 </s:complexType> 18 </s:element> 19 <s:complexType name="report-record"> 20 <s:attribute name="a" type="s:string" /> 21 <s:attribute name="b" type="s:string" /> 22 <s:attribute name="c" type="s:string" /> 23 </s:complexType> 24 12 25 <s:complexType name="ArrayOfDouble"> 13 26 <s:sequence> … … 16 29 </s:sequence> 17 30 </s:complexType> 31 18 32 <s:element name="echo"> 19 33 <s:complexType> … … 30 44 </s:complexType> 31 45 </s:element> 46 32 47 <s:element name="ArrayOfDouble" nillable="true" type="tns:ArrayOfDouble"/> 33 48 … … 39 54 </s:complexType> 40 55 </s:element> 56 41 57 <s:element name="echo2Response"> 42 58 <s:complexType> … … 46 62 </s:complexType> 47 63 </s:element> 64 48 65 <s:element name="ArrayOfComplex"> 49 66 <s:complexType> … … 53 70 </s:complexType> 54 71 </s:element> 72 55 73 <s:element name="Complex"> 56 74 <s:complexType> … … 76 94 <wsdl:part name="parameters" element="tns:echo2Response"/> 77 95 </wsdl:message> 96 <wsdl:message name="echo3In"> 97 <wsdl:part name="parameters" element="tns:ArrayOfRecord"/> 98 </wsdl:message> 99 <wsdl:message name="echo3Out"> 100 <wsdl:part name="parameters" element="tns:ArrayOfRecord"/> 101 </wsdl:message> 78 102 79 103 <wsdl:portType name="pricerSoap"> … … 87 111 <wsdl:output message="tns:echo2Out"/> 88 112 </wsdl:operation> 113 114 <wsdl:operation name="echo3"> 115 <wsdl:input message="tns:echo3In"/> 116 <wsdl:output message="tns:echo3Out"/> 117 </wsdl:operation> 89 118 </wsdl:portType> 90 119 … … 92 121 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 93 122 style="document"/> 123 94 124 <wsdl:operation name="echo"> 95 125 <soap:operation soapAction="http://tempuri.org/echo" style="document"/> … … 101 131 </wsdl:output> 102 132 </wsdl:operation> 133 103 134 <wsdl:operation name="echo2"> 104 135 <soap:operation soapAction="http://tempuri.org/echo2" style="document"/> 136 <wsdl:input> 137 <soap:body use="literal"/> 138 </wsdl:input> 139 <wsdl:output> 140 <soap:body use="literal"/> 141 </wsdl:output> 142 </wsdl:operation> 143 144 <wsdl:operation name="echo3"> 145 <soap:operation soapAction="http://tempuri.org/echo3" style="document"/> 105 146 <wsdl:input> 106 147 <soap:body use="literal"/> trunk/test/wsdl/document/array/test_array.rb
r1912 r1950 29 29 XSD::QName.new(Namespace, 'echo2Response') 30 30 ) 31 add_document_method( 32 self, 33 Namespace + 'echo3', 34 'echo3', 35 XSD::QName.new(Namespace, 'ArrayOfRecord'), 36 XSD::QName.new(Namespace, 'ArrayOfRecord') 37 ) 31 38 self.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry 32 39 end … … 37 44 38 45 def echo2(arg) 46 arg 47 end 48 49 def echo3(arg) 39 50 arg 40 51 end … … 142 153 assert_equal(nil, @client.echo(Echo.new).ary) 143 154 end 155 156 def test_attribute_array 157 @client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/") 158 @client.wiredump_dev = STDOUT if $DEBUG 159 # 160 r1 = ReportRecord.new 161 r1.xmlattr_a = "r1_xmlattr_a" 162 r1.xmlattr_b = "r1_xmlattr_b" 163 r1.xmlattr_c = "r1_xmlattr_c" 164 r2 = ReportRecord.new 165 r2.xmlattr_a = "r2_xmlattr_a" 166 r2.xmlattr_b = "r2_xmlattr_b" 167 r2.xmlattr_c = "r2_xmlattr_c" 168 arg = ArrayOfRecord[r1, r2] 169 ret = @client.echo3(arg) 170 assert_equal(arg.class , ret.class) 171 assert_equal(arg.size , ret.size) 172 assert_equal(2, ret.size) 173 assert_equal(arg[0].class, ret[0].class) 174 assert_equal(arg[0].xmlattr_a, ret[0].xmlattr_a) 175 assert_equal(arg[0].xmlattr_b, ret[0].xmlattr_b) 176 assert_equal(arg[0].xmlattr_c, ret[0].xmlattr_c) 177 assert_equal(arg[1].class, ret[1].class) 178 assert_equal(arg[1].xmlattr_a, ret[1].xmlattr_a) 179 assert_equal(arg[1].xmlattr_b, ret[1].xmlattr_b) 180 assert_equal(arg[1].xmlattr_c, ret[1].xmlattr_c) 181 # 182 arg = ArrayOfRecord[r1] 183 ret = @client.echo3(arg) 184 assert_equal(arg.class , ret.class) 185 assert_equal(arg.size , ret.size) 186 assert_equal(1, ret.size) 187 assert_equal(arg[0].class, ret[0].class) 188 assert_equal(arg[0].xmlattr_a, ret[0].xmlattr_a) 189 assert_equal(arg[0].xmlattr_b, ret[0].xmlattr_b) 190 assert_equal(arg[0].xmlattr_c, ret[0].xmlattr_c) 191 # 192 arg = ArrayOfRecord[] 193 ret = @client.echo3(arg) 194 assert_equal(arg.class , ret.class) 195 assert_equal(arg.size , ret.size) 196 assert_equal(0, ret.size) 197 end 144 198 end 145 199