1 package test.encoding; 2 3 import junit.framework.TestCase; 4 import org.apache.axis.Constants; 5 import org.apache.axis.Message; 6 import org.apache.axis.MessageContext; 7 import org.apache.axis.encoding.TypeMapping; 8 import org.apache.axis.encoding.TypeMappingRegistry; 9 import org.apache.axis.message.RPCElement; 10 import org.apache.axis.message.RPCParam; 11 import org.apache.axis.message.SOAPEnvelope; 12 import org.apache.axis.server.AxisServer; 13 import org.apache.axis.utils.JavaUtils; 14 import samples.echo.SOAPStruct; 15 import samples.echo.SOAPStructStruct; 16 17 import javax.xml.namespace.QName ; 18 import java.lang.reflect.Array ; 19 import java.util.ArrayList ; 20 import java.util.HashMap ; 21 import java.util.Hashtable ; 22 import java.util.Iterator ; 23 import java.util.List ; 24 import java.util.Map ; 25 import java.util.Set ; 26 import java.util.Vector ; 27 30 public class TestDeser extends TestCase { 31 32 private String header; 33 private String footer; 34 private AxisServer server = new AxisServer(); 35 36 public TestDeser(String name) { 37 this(name, Constants.URI_DEFAULT_SCHEMA_XSI, 38 Constants.URI_DEFAULT_SCHEMA_XSD); 39 } 40 41 public TestDeser(String name, String NS_XSI, String NS_XSD) { 42 super(name); 43 44 header = 45 "<?xml version=\"1.0\"?>\n" + 46 "<soap:Envelope " + 47 "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " + 48 "xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" " + 49 "xmlns:me=\"http://soapinterop.org/xsd\" " + 50 "xmlns:this=\"http://encoding.test\" " + 51 "xmlns:xsi=\"" + NS_XSI + "\" " + 52 "xmlns:xsd=\"" + NS_XSD + "\">\n" + 53 "<soap:Body>\n" + 54 "<methodResult xmlns=\"http://tempuri.org/\">\n"; 55 56 footer = 57 "</methodResult>\n" + 58 "</soap:Body>\n" + 59 "</soap:Envelope>\n"; 60 61 TypeMappingRegistry tmr = server.getTypeMappingRegistry(); 62 TypeMapping tm = (TypeMapping) tmr.createTypeMapping(); 63 tm.setSupportedEncodings(new String [] {Constants.URI_DEFAULT_SOAP_ENC}); 64 tmr.register(Constants.URI_DEFAULT_SOAP_ENC, tm); 65 tm.register(java.lang.String [].class, 66 new QName ("http://soapinterop.org/xsd", "ArrayOfString"), 67 new org.apache.axis.encoding.ser.ArraySerializerFactory(), 68 new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); 69 tm.register(java.lang.Object [].class, 70 new QName ("http://soapinterop.org/xsd", "ArrayOfObject"), 71 new org.apache.axis.encoding.ser.ArraySerializerFactory(), 72 new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); 73 tm.register(samples.echo.SOAPStruct.class, 74 new QName ("http://soapinterop.org/xsd", "SOAPStruct"), 75 new org.apache.axis.encoding.ser.BeanSerializerFactory( 76 samples.echo.SOAPStruct.class, 77 new QName ("http://soapinterop.org/xsd", "SOAPStruct")), 78 new org.apache.axis.encoding.ser.BeanDeserializerFactory( 79 samples.echo.SOAPStruct.class, 80 new QName ("http://soapinterop.org/xsd", "SOAPStruct"))); 81 tm.register(samples.echo.SOAPStruct[].class, 82 new QName ("http://soapinterop.org/xsd", "ArrayOfSOAPStruct"), 83 new org.apache.axis.encoding.ser.ArraySerializerFactory(), 84 new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); 85 tm.register(samples.echo.SOAPStructStruct.class, 86 new QName ("http://soapinterop.org/xsd", "SOAPStructStruct"), 87 new org.apache.axis.encoding.ser.BeanSerializerFactory( 88 samples.echo.SOAPStructStruct.class, 89 new QName ("http://soapinterop.org/xsd", "SOAPStructStruct")), 90 new org.apache.axis.encoding.ser.BeanDeserializerFactory( 91 samples.echo.SOAPStructStruct.class, 92 new QName ("http://soapinterop.org/xsd", "SOAPStructStruct"))); 93 tm.register(test.encoding.IndexPropBean.class, 94 new QName ("http://encoding.test", "IndexPropBean"), 95 new org.apache.axis.encoding.ser.BeanSerializerFactory( 96 test.encoding.IndexPropBean.class, 97 new QName ("http://encoding.test", "IndexPropBean")), 98 new org.apache.axis.encoding.ser.BeanDeserializerFactory( 99 test.encoding.IndexPropBean.class, 100 new QName ("http://encoding.test", "IndexPropBean"))); 101 } 102 103 106 private static boolean equals(Object obj1, Object obj2) { 107 if ( (obj1 == null) || (obj2 == null) ) return (obj1 == obj2); 108 if (obj1.equals(obj2)) return true; 109 if (obj2.getClass().isArray() && obj1.getClass().isArray()) { 110 if (Array.getLength(obj1) != Array.getLength(obj2)) return false; 111 for (int i=0; i<Array.getLength(obj1); i++) 112 if (!equals(Array.get(obj1,i),Array.get(obj2,i))) return false; 113 return true; 114 } 115 if ((obj1 instanceof List ) && (obj2 instanceof List )) { 116 List list1 = (List )obj1; 117 List list2 = (List )obj2; 118 if (list1.size() != list2.size()) return false; 119 for (int i=0; i < list1.size(); i++) { 120 if (!equals(list1.get(i), list2.get(i))) return false; 121 } 122 return true; 123 } 124 if ((obj1 instanceof Map ) && (obj2 instanceof Map )) { 125 Map map1 = (Map )obj1; 126 Map map2 = (Map )obj2; 127 Set keys1 = map1.keySet(); 128 Set keys2 = map2.keySet(); 129 if (!(keys1.equals(keys2))) return false; 130 Iterator i = keys1.iterator(); 131 while (i.hasNext()) { 132 Object key = i.next(); 133 if (!map1.get(key).equals(map2.get(key))) 134 return false; 135 } 136 return true; 137 } 138 139 return false; 140 } 141 142 145 protected void deserialize(String data, Object expected) 146 throws Exception { 147 deserialize(data, expected, false); 148 } 149 150 protected void deserialize(String data, Object expected, boolean tryConvert) 151 throws Exception { 152 deserialize(data, expected,tryConvert,""); 153 } 154 155 156 164 protected void deserialize(String data, Object expected, boolean tryConvert, String comment) 165 throws Exception 166 { 167 Message message = new Message(header + data + footer); 168 message.setMessageContext(new MessageContext(server)); 169 String postfix=""; 170 if(comment!=null) { 171 postfix=" "+comment; 172 } 173 174 SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPEnvelope(); 175 assertNotNull("SOAP envelope should not be null"+ postfix, envelope); 176 177 RPCElement body = (RPCElement)envelope.getFirstBody(); 178 assertNotNull("SOAP body should not be null" + postfix, body); 179 180 Vector arglist = body.getParams(); 181 assertNotNull("arglist", arglist); 182 assertTrue("param.size()<=0 {Should be > 0}" + postfix, arglist.size()>0); 183 184 RPCParam param = (RPCParam) arglist.get(0); 185 assertNotNull("SOAP param should not be null" + postfix, param); 186 187 Object result = param.getObjectValue(); 188 if (!equals(result, expected)) { 189 String errorText = "Failed to decode " + data + postfix+" : "; 190 if (tryConvert) { 192 Object result2 = JavaUtils.convert(result, expected.getClass()); 193 if (!equals(result2, expected)) { 194 195 assertEquals(errorText, expected, result); 196 } 197 } else { 198 assertEquals(errorText, expected, result); 199 } 200 } 201 } 202 203 public void testString() throws Exception { 204 deserialize("<result xsi:type=\"xsd:string\">abc</result>", 205 "abc"); 206 } 207 208 public void testBoolean() throws Exception { 209 deserialize("<result xsi:type=\"xsd:boolean\">false</result>", 210 new Boolean (false)); 211 deserialize("<result xsi:type=\"xsd:boolean\">true</result>", 212 new Boolean (true)); 213 deserialize("<result xsi:type=\"xsd:boolean\">0</result>", 214 new Boolean (false)); 215 deserialize("<result xsi:type=\"xsd:boolean\">1</result>", 216 new Boolean (true)); 217 } 218 219 public void testDouble() throws Exception { 220 deserialize("<result xsi:type=\"xsd:double\">3.14</result>", 221 new Double (3.14)); 222 } 223 224 public void testDoubleNaN() throws Exception { 225 deserialize("<result xsi:type=\"xsd:double\">NaN</result>", 226 new Double (Double.NaN)); 227 } 228 229 public void testDoubleINF() throws Exception { 230 deserialize("<result xsi:type=\"xsd:double\">INF</result>", 231 new Double (Double.POSITIVE_INFINITY)); 232 } 233 234 public void testDoubleNINF() throws Exception { 235 deserialize("<result xsi:type=\"xsd:double\">-INF</result>", 236 new Double (Double.NEGATIVE_INFINITY)); 237 } 238 239 public void testFloat() throws Exception { 240 deserialize("<result xsi:type=\"xsd:float\">3.14</result>", 241 new Float (3.14F)); 242 } 243 244 public void testFloatNaN() throws Exception { 245 deserialize("<result xsi:type=\"xsd:float\">NaN</result>", 246 new Float (Float.NaN)); 247 } 248 249 public void testFloatINF() throws Exception { 250 deserialize("<result xsi:type=\"xsd:float\">INF</result>", 251 new Float (Float.POSITIVE_INFINITY)); 252 } 253 254 public void testFloatNINF() throws Exception { 255 deserialize("<result xsi:type=\"xsd:float\">-INF</result>", 256 new Float (Float.NEGATIVE_INFINITY)); 257 } 258 259 public void testInt() throws Exception { 260 deserialize("<result xsi:type=\"xsd:int\">10</result>", 261 new Integer (10)); 262 } 263 264 public void testLong() throws Exception { 265 deserialize("<result xsi:type=\"xsd:long\">17</result>", 266 new Long (17)); 267 } 268 269 public void testShort() throws Exception { 270 deserialize("<result xsi:type=\"xsd:short\">3</result>", 271 new Short ((short)3)); 272 } 273 274 public void testArray() throws Exception { 275 Vector v = new Vector (); 276 v.addElement("abc"); 277 v.addElement("def"); 278 deserialize("<result xsi:type=\"soapenc:Array\" " + 279 "soapenc:arrayType=\"xsd:string[2]\"> " + 280 "<item xsi:type=\"xsd:string\">abc</item>" + 281 "<item xsi:type=\"xsd:string\">def</item>" + 282 "</result>", 283 v, true); 284 } 285 286 public void testSparseArray1() throws Exception { 287 ArrayList list = new ArrayList (4); 288 list.add(null); 289 list.add(null); 290 list.add("abc"); 291 list.add("def"); 292 deserialize("<result xsi:type=\"soapenc:Array\" " + 293 "soapenc:arrayType=\"xsd:string[4]\" " + 294 "soapenc:offset=\"[2]\"> " + 295 "<item xsi:type=\"xsd:string\">abc</item>" + 296 "<item xsi:type=\"xsd:string\">def</item>" + 297 "</result>", 298 list, true); 299 } 300 301 public void testSparseArray2() throws Exception { 302 ArrayList list = new ArrayList (4); 303 list.add("abc"); 304 list.add(null); 305 list.add("def"); 306 deserialize("<result xsi:type=\"soapenc:Array\" " + 307 "soapenc:arrayType=\"xsd:string[4]\"> " + 308 "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" + 309 "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" + 310 "</result>", 311 list, true); 312 } 313 314 public void testHugeSparseArray() throws Exception { 315 ArrayList list = new ArrayList (4); 316 list.add("abc"); 317 list.add(null); 318 list.add("def"); 319 deserialize("<result xsi:type=\"soapenc:Array\" " + 320 "soapenc:arrayType=\"xsd:string[50000000]\"> " + 321 "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" + 322 "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" + 323 "</result>", 324 list, true); 325 } 326 public void testMap() throws Exception { 327 HashMap m = new HashMap (); 328 m.put("abcKey", "abcVal"); 329 m.put("defKey", "defVal"); 330 deserialize("<result xsi:type=\"xmlsoap:Map\" " + 331 "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " + 332 "<item>" + 333 "<key xsi:type=\"xsd:string\">abcKey</key>" + 334 "<value xsi:type=\"xsd:string\">abcVal</value>" + 335 "</item><item>" + 336 "<key xsi:type=\"xsd:string\">defKey</key>" + 337 "<value xsi:type=\"xsd:string\">defVal</value>" + 338 "</item>" + 339 "</result>", 340 m); 341 } 342 343 public void testHashtable() throws Exception { 344 Hashtable ht = new Hashtable (); 345 ht.put("abcKey", "abcVal"); 346 ht.put("defKey", "defVal"); 347 deserialize("<result xsi:type=\"xmlsoap:Map\" " + 348 "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " + 349 "<item>" + 350 "<key xsi:type=\"xsd:string\">abcKey</key>" + 351 "<value xsi:type=\"xsd:string\">abcVal</value>" + 352 "</item><item>" + 353 "<key xsi:type=\"xsd:string\">defKey</key>" + 354 "<value xsi:type=\"xsd:string\">defVal</value>" + 355 "</item>" + 356 "</result>", 357 ht, true); 358 } 359 360 public void testUntyped() throws Exception { 361 deserialize("<result>10</result>", "10"); 362 } 363 364 public void testSOAPString() throws Exception { 365 deserialize("<result xsi:type=\"soapenc:string\">abc</result>", 366 "abc"); 367 } 368 369 371 public void testArrayA() throws Exception { 373 String [] s = new String [] {"abc", "def"}; 374 deserialize("<result xsi:type=\"soapenc:Array\" " + 375 "soapenc:arrayType=\"xsd:string[2]\"> " + 376 "<item xsi:type=\"xsd:string\">abc</item>" + 377 "<item xsi:type=\"xsd:string\">def</item>" + 378 "</result>", 379 s, true); 380 } 381 382 public void testArrayB() throws Exception { 384 String [] s = new String [] {"abc", "def"}; 385 deserialize("<result xsi:type=\"soapenc:Array\" " + 386 "soapenc:arrayType=\"xsd:string[]\"> " + 387 "<item xsi:type=\"xsd:string\">abc</item>" + 388 "<item xsi:type=\"xsd:string\">def</item>" + 389 "</result>", 390 s, true); 391 } 392 393 394 public void testArrayC() throws Exception { 396 String [] s = new String [] {"abc", "def"}; 397 deserialize("<result xsi:type=\"soapenc:Array\" " + 398 "soapenc:arrayType=\"xsd:string[]\"> " + 399 "<item>abc</item>" + 400 "<item>def</item>" + 401 "</result>", 402 s, true); 403 } 404 405 public void testArrayD() throws Exception { 407 String [] s = new String [] {"abc", "def"}; 408 deserialize("<result xsi:type=\"soapenc:Array\" " + 409 "soapenc:arrayType=\"xsd:anyType[]\"> " + 410 "<item xsi:type=\"xsd:string\">abc</item>" + 411 "<item xsi:type=\"xsd:string\">def</item>" + 412 "</result>", 413 s, true); 414 } 415 416 public void testArrayE() throws Exception { 418 String [] s = new String [] {"abc", "def"}; 419 deserialize("<result xsi:type=\"soapenc:Array\" " + 420 "> " + 421 "<item xsi:type=\"xsd:string\">abc</item>" + 422 "<item xsi:type=\"xsd:string\">def</item>" + 423 "</result>", 424 s, true); 425 } 426 427 public void testArrayF() throws Exception { 429 String [] s = new String [] {"abc", "def"}; 430 deserialize("<result xsi:type=\"me:ArrayOfString\" " + 431 "> " + 432 "<item xsi:type=\"xsd:string\">abc</item>" + 433 "<item xsi:type=\"xsd:string\">def</item>" + 434 "</result>", 435 s, true); 436 } 437 438 public void testArrayG() throws Exception { 440 String [] s = new String [] {"abc", "def"}; 441 deserialize("<result xsi:type=\"me:ArrayOfString\" " + 442 "> " + 443 "<item>abc</item>" + 444 "<item>def</item>" + 445 "</result>", 446 s, true); 447 } 448 449 public void testArrayH() throws Exception { 451 Object [] s = new Object [] {new String ("abc"), new String ("def")}; 452 deserialize("<result xsi:type=\"me:ArrayOfString\" " + 453 "> " + 454 "<item>abc</item>" + 455 "<item>def</item>" + 456 "</result>", 457 s, true); 458 } 459 460 public void testArrayI() throws Exception { 463 Object [] s = new Object [] {new String ("abc"), new Integer (123)}; 464 deserialize("<result xsi:type=\"me:ArrayOfObject\" " + 465 "> " + 466 "<item xsi:type=\"xsd:string\">abc</item>" + 467 "<item xsi:type=\"soapenc:int\">123</item>" + 468 "</result>", 469 s, true); 470 } 471 472 public void testArrayJ() throws Exception { 474 Object [] s = new Object [] {new String ("abc"), new Integer (123)}; 475 deserialize("<result xsi:type=\"me:ArrayOfObject\" " + 476 "soapenc:arrayType=\"xsd:anyType[]\"> " + 477 "<item xsi:type=\"xsd:string\">abc</item>" + 478 "<item xsi:type=\"soapenc:int\">123</item>" + 479 "</result>", 480 s, true); 481 } 482 483 public void testArrayK() throws Exception { 485 Object [] s = new Object [] {new String ("abc"), new Integer (123)}; 486 deserialize("<result xsi:type=\"soapenc:Array\" " + 487 "> " + 488 "<item xsi:type=\"xsd:string\">abc</item>" + 489 "<item xsi:type=\"soapenc:int\">123</item>" + 490 "</result>", 491 s, true); 492 } 493 494 public void testArrayL() throws Exception { 496 SOAPStruct[] s = new SOAPStruct[] { 497 new SOAPStruct(), 498 new SOAPStruct(), 499 new SOAPStruct()}; 500 s[0].setVarInt(1); 501 s[0].setVarString("one"); 502 s[0].setVarFloat(1.1F); 503 s[1].setVarInt(2); 504 s[1].setVarString("two"); 505 s[1].setVarFloat(2.2F); 506 s[2].setVarInt(3); 507 s[2].setVarString("three"); 508 s[2].setVarFloat(3.3F); 509 510 deserialize("<soapenc:Array id=\"ref-7\" soapenc:arrayType=\"me:SOAPStruct[3]\">" + 511 "<item HREF=\"#ref-8\"/>" + 512 "<item HREF=\"#ref-9\"/>" + 513 "<item HREF=\"#ref-10\"/>" + 514 "</soapenc:Array>" + 515 516 "<me:SOAPStruct id=\"ref-8\">" + 517 "<varString xsi:type=\"xsd:string\">one</varString>" + 518 "<varInt xsi:type=\"xsd:int\">1</varInt>" + 519 "<varFloat xsi:type=\"xsd:float\">1.1</varFloat>" + 520 "</me:SOAPStruct>" + 521 522 "<me:SOAPStruct id=\"ref-9\">" + 523 "<varString xsi:type=\"xsd:string\">two</varString>" + 524 "<varInt xsi:type=\"xsd:int\">2</varInt>" + 525 "<varFloat xsi:type=\"xsd:float\">2.2</varFloat>" + 526 "</me:SOAPStruct>" + 527 528 "<me:SOAPStruct id=\"ref-10\">" + 529 "<varString xsi:type=\"xsd:string\">three</varString>" + 530 "<varInt xsi:type=\"xsd:int\">3</varInt>" + 531 "<varFloat xsi:type=\"xsd:float\">3.3</varFloat>" + 532 "</me:SOAPStruct>", 533 s, true); 534 } 535 536 public void testArrayM() throws Exception { 538 SOAPStruct[] s = new SOAPStruct[] { 539 new SOAPStruct(), 540 new SOAPStruct(), 541 new SOAPStruct()}; 542 s[0].setVarInt(1); 543 s[0].setVarString("one"); 544 s[0].setVarFloat(1.1F); 545 s[1].setVarInt(2); 546 s[1].setVarString("two"); 547 s[1].setVarFloat(2.2F); 548 s[2].setVarInt(3); 549 s[2].setVarString("three"); 550 s[2].setVarFloat(3.3F); 551 deserialize("<soapenc:Array id=\"ref-7\" soapenc:arrayType=\"me:SOAPStruct[3]\">" + 552 "<me:SOAPStruct>" + 553 "<varString xsi:type=\"xsd:string\">one</varString>" + 554 "<varInt xsi:type=\"xsd:int\">1</varInt>" + 555 "<varFloat xsi:type=\"xsd:float\">1.1</varFloat>" + 556 "</me:SOAPStruct>" + 557 558 "<me:SOAPStruct>" + 559 "<varString xsi:type=\"xsd:string\">two</varString>" + 560 "<varInt xsi:type=\"xsd:int\">2</varInt>" + 561 "<varFloat xsi:type=\"xsd:float\">2.2</varFloat>" + 562 "</me:SOAPStruct>" + 563 564 "<me:SOAPStruct>" + 565 "<varString xsi:type=\"xsd:string\">three</varString>" + 566 "<varInt xsi:type=\"xsd:int\">3</varInt>" + 567 "<varFloat xsi:type=\"xsd:float\">3.3</varFloat>" + 568 "</me:SOAPStruct>" + 569 570 "</soapenc:Array>", 571 s, true); 572 } 573 public void testBeanWithIndexedPropA() throws Exception { 575 IndexPropBean s = new IndexPropBean(); 576 s.setName(new String [] {"hello", "goodbye"}); 577 deserialize("<result xsi:type=\"this:IndexPropBean\" " + "> " + 578 "<name HREF=\"#ref-1\"/>" + 579 "<name HREF=\"#ref-2\"/>" + 580 "</result>" + 581 "<item id=\"ref-1\" xsi:type=\"xsd:string\">hello</item>" + 582 "<item id=\"ref-2\" xsi:type=\"xsd:string\">goodbye</item>", 583 s, true); 584 } 585 public void testBeanWithIndexedPropB() throws Exception { 587 IndexPropBean s = new IndexPropBean(); 588 s.setName(new String [] {"hello", "goodbye"}); 589 deserialize("<result xsi:type=\"this:IndexPropBean\" " + "> " + 590 "<name HREF=\"#ref-0\" /> " + 591 "</result>" + 592 "<soapenc:Array id=\"ref-0\" soapenc:arrayType=\"xsd:string[2]\"> " + 593 "<item xsi:type=\"xsd:string\">hello</item>" + 594 "<item xsi:type=\"xsd:string\">goodbye</item>" + 595 "</soapenc:Array>", 596 s, true); 597 } 598 public void testStructStruct() throws Exception { 600 601 SOAPStruct s = new samples.echo.SOAPStruct(); 602 s.setVarInt(1); 603 s.setVarString("one"); 604 s.setVarFloat(1.1F); 605 SOAPStructStruct ss = new SOAPStructStruct(); 606 ss.setVarString("hello"); 607 ss.setVarInt(2); 608 ss.setVarFloat(2.2F); 609 ss.setVarStruct(s); 610 611 deserialize("<whatever xsi:type=\"me:SOAPStructStruct\">" + 612 "<varString xsi:type=\"xsd:string\">hello</varString>" + 613 "<varInt xsi:type=\"xsd:int\">2</varInt>" + 614 "<varFloat xsi:type=\"xsd:float\">2.2</varFloat>" + 615 "<varStruct xsi:type=\"me:SOAPStruct\">" + 616 "<varString xsi:type=\"xsd:string\">one</varString>" + 617 "<varInt xsi:type=\"xsd:int\">1</varInt>" + 618 "<varFloat xsi:type=\"xsd:float\">1.1</varFloat>" + 619 "</varStruct>" + 620 "</whatever>" , ss, true); 621 } 622 623 640 641 public void testStructStruct2() throws Exception { 643 SOAPStruct s = new samples.echo.SOAPStruct(); 644 s.setVarInt(1); 645 s.setVarString("one"); 646 s.setVarFloat(1.1F); 647 SOAPStructStruct ss = new SOAPStructStruct(); 648 ss.setVarString("hello"); 649 ss.setVarInt(2); 650 ss.setVarFloat(2.2F); 651 ss.setVarStruct(s); 652 653 deserialize("<whatever xsi:type=\"me:SOAPStructStruct\">" + 654 "<varString>hello</varString>" + 655 "<varInt>2</varInt>" + 656 "<varFloat>2.2</varFloat>" + 657 "<varStruct>" + 658 "<varString>one</varString>" + 659 "<varInt>1</varInt>" + 660 "<varFloat>1.1</varFloat>" + 661 "</varStruct>" + 662 "</whatever>" , ss, true); 663 } 664 } 665 | Popular Tags |