1 16 17 package test.wsdl.roundtrip; 18 19 import test.wsdl.roundtrip.holders.BondInvestmentHolder; 20 21 import javax.xml.rpc.holders.StringHolder ; 22 import java.math.BigDecimal ; 23 import java.math.BigInteger ; 24 import java.rmi.RemoteException ; 25 import java.util.Calendar ; 26 import java.util.Date ; 27 import java.util.HashMap ; 28 import java.util.TimeZone ; 29 30 38 public class RoundtripTestSoapBindingImpl implements RoundtripPortType { 39 40 public float getRealtimeLastTradePrice(StockInvestment in0) throws RemoteException { 41 42 if ((in0.getLastTradePrice() == 200.55F) && 43 (in0.getTradeExchange().equals("NYSE")) && 44 (in0.getName().equals("International Business Machines")) && 45 (in0.getId() == 1)) { 46 return 201.25F; 47 } else { 48 throw new RemoteException ("Actual Value Did Not Match Expected Value."); 49 } 50 51 } 53 public PreferredStockInvestment getDividends(PreferredStockInvestment in0) throws RemoteException { 54 55 if ((in0.getLastTradePrice() == 10.50F) && 56 (in0.getTradeExchange().equals("NASDAQ")) && 57 (in0.getName().equals("SOAP Inc.")) && 58 (in0.getId() == 202) && 59 (in0.getDividendsInArrears() == 100.44D) && 60 (in0.getPreferredYield().equals(new BigDecimal ("7.00")))) { 61 in0.setName("AXIS Inc."); 62 in0.setId(203); 63 in0.setTradeExchange("NASDAQ"); 64 in0.setLastTradePrice(11.50F); 65 in0.setDividendsInArrears(101.44D); 66 in0.setPreferredYield(new BigDecimal ("8.00")); 67 return in0; 68 } else { 69 throw new RemoteException ("Actual Value Did Not Match Expected Value."); 70 } 71 72 } 74 public BondInvestment methodBondInvestmentInOut(BondInvestment in0) throws RemoteException { 75 76 short[] shortArray = {(short) 36}; 77 byte[] byteArray = {(byte) 7}; 78 CallOptions[] callOptions = new CallOptions[2]; 79 callOptions[0] = new CallOptions(); 80 Calendar date = Calendar.getInstance(); 81 TimeZone gmt = TimeZone.getTimeZone("GMT"); 82 date.setTimeZone(gmt); 83 date.setTime(new Date (1013441507308L)); 84 callOptions[0].setCallDate(date); 85 callOptions[1] = new CallOptions(); 86 date = Calendar.getInstance(); 87 date.setTimeZone(gmt); 88 date.setTime(new Date (1013441507328L)); 89 callOptions[1].setCallDate(date); 90 HashMap map = new HashMap (); 91 map.put("Test", "Test Works"); 92 93 Short [] wrapperShortArray = {new Short ((short) 33), new Short ((short) 86)}; 94 Byte [] wrapperByteArray = {new Byte ((byte) 4), new Byte ((byte) 18)}; 95 96 BondInvestment sendValue = new BondInvestment(); 97 98 sendValue.setMap(map); 99 sendValue.setOptions(callOptions); 100 sendValue.setOptions2(callOptions); 101 sendValue.setOptions3(callOptions[0]); 102 sendValue.setWrapperShortArray(wrapperShortArray); 103 sendValue.setWrapperByteArray(wrapperByteArray); 104 sendValue.setWrapperDouble(new Double (33.232D)); 105 sendValue.setWrapperFloat(new Float (2.23F)); 106 sendValue.setWrapperInteger(new Integer (3)); 107 sendValue.setWrapperShort(new Short ((short) 2)); 108 sendValue.setWrapperByte(new Byte ((byte) 21)); 109 sendValue.setWrapperBoolean(new Boolean (false)); 110 sendValue.setShortArray(shortArray); 111 sendValue.setByteArray(byteArray); 112 date = Calendar.getInstance(); 113 date.setTimeZone(gmt); 114 date.setTime(new Date (1012937862997L)); 115 sendValue.setCallableDate(date); 116 sendValue.setBondAmount(new BigDecimal ("2735.23")); 117 sendValue.setPortfolioType(new BigInteger ("21093")); 118 sendValue.setTradeExchange("AMEX"); 119 sendValue.setFiftyTwoWeekHigh(415.012D); 120 sendValue.setLastTradePrice(8795.32F); 121 sendValue.setYield(575L); 122 sendValue.setStockBeta(3); 123 sendValue.setDocType((short) 45); 124 sendValue.setTaxIndicator((byte) 8); 125 126 if ((in0.getStockBeta() == 32) && 127 (in0.getDocType() == (short) 35) && 128 (in0.getTaxIndicator() == (byte) 3)) 129 ; 130 else 131 throw new RemoteException ("Actual attribute values did not match expected values."); 132 133 Calendar expectedDate0 = Calendar.getInstance(); 134 expectedDate0.setTimeZone(gmt); 135 expectedDate0.setTime(new Date (1013441507388L)); 136 Calendar expectedDate1 = Calendar.getInstance(); 137 expectedDate1.setTimeZone(gmt); 138 expectedDate1.setTime(new Date (1013441507390L)); 139 Calendar expectedDate2 = Calendar.getInstance(); 140 expectedDate2.setTimeZone(gmt); 141 expectedDate2.setTime(new Date (1013441507388L)); 142 Calendar expectedDate3 = Calendar.getInstance(); 143 expectedDate3.setTimeZone(gmt); 144 expectedDate3.setTime(new Date (1013441507390L)); 145 Calendar expectedDate4 = Calendar.getInstance(); 146 expectedDate4.setTimeZone(gmt); 147 expectedDate4.setTime(new Date (1012937861996L)); 148 if ((in0.getMap().get("Test").equals("Test Works")) && 149 (in0.getOptions()[0].getCallDate().equals(expectedDate0)) && 150 (in0.getOptions()[1].getCallDate().equals(expectedDate1)) && 151 (((CallOptions[])in0.getOptions2())[0].getCallDate().equals(expectedDate2)) && 152 (((CallOptions[])in0.getOptions2())[1].getCallDate().equals(expectedDate3)) && 153 (in0.getWrapperShortArray()[0].equals(new Short ((short) 23))) && 154 (in0.getWrapperShortArray()[1].equals(new Short ((short) 56))) && 155 (in0.getWrapperByteArray()[0].equals(new Byte ((byte) 2))) && 156 (in0.getWrapperByteArray()[1].equals(new Byte ((byte) 15))) && 157 (in0.getWrapperDouble().equals(new Double (2323.232D))) && 158 (in0.getWrapperFloat().equals(new Float (23.023F))) && 159 (in0.getWrapperInteger().equals(new Integer (2093))) && 160 (in0.getWrapperShort().equals(new Short ((short) 203))) && 161 (in0.getWrapperByte().equals(new Byte ((byte) 20))) && 162 (in0.getWrapperBoolean().equals(new Boolean (true))) && 163 (in0.getShortArray()[0] == (short) 30) && 164 (in0.getByteArray()[0] == (byte) 1) && 165 (in0.getCallableDate().equals(expectedDate4)) && 166 (in0.getBondAmount().equals(new BigDecimal ("2675.23"))) && 167 (in0.getPortfolioType().equals(new BigInteger ("2093"))) && 168 (in0.getTradeExchange().equals("NYSE")) && 169 (in0.getFiftyTwoWeekHigh() == 45.012D) && 170 (in0.getLastTradePrice() == 87895.32F) && 171 (in0.getYield() == 5475L) && 172 (in0.getStockBeta() == 32) && 173 (in0.getDocType() == (short) 35) && 174 (in0.getTaxIndicator() == (byte) 3)) { 175 return sendValue; 176 } else { 177 throw new RemoteException ("Actual values did not match expected values."); 178 } 179 180 } 182 public BondInvestment methodBondInvestmentOut() throws RemoteException { 183 184 short[] shortArray = {(short) 36}; 185 byte[] byteArray = {(byte) 7}; 186 CallOptions[] callOptions = new CallOptions[2]; 187 callOptions[0] = new CallOptions(); 188 Calendar date = Calendar.getInstance(); 189 TimeZone gmt = TimeZone.getTimeZone("GMT"); 190 date.setTimeZone(gmt); 191 date.setTime(new Date (1013441507308L)); 192 callOptions[0].setCallDate(date); 193 callOptions[1] = new CallOptions(); 194 date = Calendar.getInstance(); 195 date.setTimeZone(gmt); 196 date.setTime(new Date (1013441507328L)); 197 callOptions[1].setCallDate(date); 198 Short [] wrapperShortArray = {new Short ((short) 33), new Short ((short) 86)}; 199 Byte [] wrapperByteArray = {new Byte ((byte) 4), new Byte ((byte) 18)}; 200 HashMap map = new HashMap (); 201 map.put("Test", "Test Works"); 202 203 204 BondInvestment sendValue = new BondInvestment(); 205 206 sendValue.setMap(map); 207 sendValue.setOptions(callOptions); 208 sendValue.setOptions2(callOptions); 209 sendValue.setOptions3(callOptions[0]); 210 sendValue.setWrapperShortArray(wrapperShortArray); 211 sendValue.setWrapperByteArray(wrapperByteArray); 212 sendValue.setWrapperDouble(new Double (33.232D)); 213 sendValue.setWrapperFloat(new Float (2.23F)); 214 sendValue.setWrapperInteger(new Integer (3)); 215 sendValue.setWrapperShort(new Short ((short) 2)); 216 sendValue.setWrapperByte(new Byte ((byte) 21)); 217 sendValue.setWrapperBoolean(new Boolean (false)); 218 sendValue.setShortArray(shortArray); 219 sendValue.setByteArray(byteArray); 220 date = Calendar.getInstance(); 221 date.setTimeZone(gmt); 222 date.setTime(new Date (1012937862997L)); 223 sendValue.setCallableDate(date); 224 sendValue.setBondAmount(new BigDecimal ("2735.23")); 225 sendValue.setPortfolioType(new BigInteger ("21093")); 226 sendValue.setTradeExchange("AMEX"); 227 sendValue.setFiftyTwoWeekHigh(415.012D); 228 sendValue.setLastTradePrice(8795.32F); 229 sendValue.setYield(575L); 230 sendValue.setStockBeta(3); 231 sendValue.setDocType((short) 45); 232 sendValue.setTaxIndicator((byte) 8); 233 234 return sendValue; 235 236 } 238 public void methodBondInvestmentIn(BondInvestment in0) throws RemoteException { 239 Calendar expectedDate0 = Calendar.getInstance(); 240 TimeZone gmt = TimeZone.getTimeZone("GMT"); 241 expectedDate0.setTimeZone(gmt); 242 expectedDate0.setTime(new Date (1013441507388L)); 243 Calendar expectedDate1 = Calendar.getInstance(); 244 expectedDate1.setTimeZone(gmt); 245 expectedDate1.setTime(new Date (1013441507390L)); 246 Calendar expectedDate2 = Calendar.getInstance(); 247 expectedDate2.setTimeZone(gmt); 248 expectedDate2.setTime(new Date (1013441507388L)); 249 Calendar expectedDate3 = Calendar.getInstance(); 250 expectedDate3.setTimeZone(gmt); 251 expectedDate3.setTime(new Date (1013441507390L)); 252 Calendar expectedDate4 = Calendar.getInstance(); 253 expectedDate4.setTimeZone(gmt); 254 expectedDate4.setTime(new Date (1012937861996L)); 255 if (!((in0.getMap().get("Test").equals("Test Works")) && 256 (in0.getOptions()[0].getCallDate().equals(expectedDate0)) && 257 (in0.getOptions()[1].getCallDate().equals(expectedDate1)) && 258 (((CallOptions[])in0.getOptions2())[0].getCallDate().equals(expectedDate2)) && 259 (((CallOptions[])in0.getOptions2())[1].getCallDate().equals(expectedDate3)) && 260 (in0.getWrapperShortArray()[0].equals(new Short ((short) 23))) && 261 (in0.getWrapperShortArray()[1].equals(new Short ((short) 56))) && 262 (in0.getWrapperByteArray()[0].equals(new Byte ((byte) 2))) && 263 (in0.getWrapperByteArray()[1].equals(new Byte ((byte) 15))) && 264 (in0.getWrapperDouble().equals(new Double (2323.232D))) && 265 (in0.getWrapperFloat().equals(new Float (23.023F))) && 266 (in0.getWrapperInteger().equals(new Integer (2093))) && 267 (in0.getWrapperShort().equals(new Short ((short) 203))) && 268 (in0.getWrapperByte().equals(new Byte ((byte) 20))) && 269 (in0.getWrapperBoolean().equals(new Boolean (true))) && 270 (in0.getShortArray()[0] == (short) 30) && 271 (in0.getByteArray()[0] == (byte) 1) && 272 (in0.getCallableDate().equals(expectedDate4)) && 273 (in0.getBondAmount().equals(new BigDecimal ("2675.23"))) && 274 (in0.getPortfolioType().equals(new BigInteger ("2093"))) && 275 (in0.getTradeExchange().equals("NYSE")) && 276 (in0.getFiftyTwoWeekHigh() == 45.012D) && 277 (in0.getLastTradePrice() == 87895.32F) && 278 (in0.getYield() == 5475L) && 279 (in0.getStockBeta() == 32) && 280 (in0.getDocType() == (short) 35) && 281 (in0.getTaxIndicator() == (byte) 3))) { 282 throw new RemoteException ("Actual values did not match expected values."); 283 } 284 285 } 287 public String [][] methodStringMArrayOut() throws RemoteException { 288 289 String [][] sendArray = { {"Out-0-0"}, {"Out-1-0"}}; 290 return sendArray; 291 292 } 294 public void methodStringMArrayIn(String [][] in0) throws RemoteException { 295 296 if (!((in0[0][0].equals("In-0-0")) && 297 (in0[0][1].equals("In-0-1")) && 298 (in0[1][0].equals("In-1-0")) && 299 (in0[1][1].equals("In-1-1")))) { 300 throw new RemoteException ("The actual values did not match expected values."); 301 } 302 303 } 305 public String [][] methodStringMArrayInOut(String [][] in0) throws RemoteException { 306 307 String [][] sendArray = { {"Response-0-0", "Response-0-1"}, {"Response-1-0", "Response-1-1"}}; 308 309 if ((in0[0][0].equals("Request-0-0")) && 310 (in0[0][1].equals("Request-0-1")) && 311 (in0[1][0].equals("Request-1-0")) && 312 (in0[1][1].equals("Request-1-1"))) { 313 return sendArray; 314 } else { 315 throw new RemoteException ("The actual values did not match expected values."); 316 } 317 318 } 320 public int[] methodIntArrayOut() throws RemoteException { 321 322 int[] returnByteArray = {3, 78, 102}; 323 return returnByteArray; 324 325 } 327 public void methodIntArrayIn(int[] in0) throws RemoteException { 328 329 if (!((in0[0] == 91) && 330 (in0[1] == 54) && 331 (in0[2] == 47) && 332 (in0[3] == 10))) { 333 throw new RemoteException ("The actual values did not match expected values."); 334 } 335 336 } 338 public int[] methodIntArrayInOut(int[] in0) throws RemoteException { 339 340 int[] returnByteArray = {12, 39, 50, 60, 28, 39}; 341 342 if ((in0[0] == 90) && 343 (in0[1] == 34) && 344 (in0[2] == 45) && 345 (in0[3] == 239) && 346 (in0[4] == 45) && 347 (in0[5] == 10)) { 348 return returnByteArray; 349 } else { 350 throw new RemoteException ("The actual values did not match expected values."); 351 } 352 353 } 355 public void methodAllTypesIn(String in0, 356 BigInteger in1, 357 BigDecimal in2, 358 Calendar in35, 359 Calendar in36, 360 boolean in4, 361 byte in5, 362 short in6, 363 int in7, 364 long in8, 365 float in9, 366 double in10, 367 byte[] in11, 368 Boolean in13, 369 Byte in14, 370 Short in15, 371 Integer in16, 372 Long in17, 373 Float in18, 374 Double in19, 375 Byte [] in12) throws RemoteException { 376 Calendar expectedDateTime = Calendar.getInstance(); 377 TimeZone gmt = TimeZone.getTimeZone("GMT"); 378 expectedDateTime.setTimeZone(gmt); 379 expectedDateTime.setTime(new Date (1012937861986L)); 380 if (!((in0.equals(new String ("Request methodAllTypesIn"))) && 381 (in1.equals(new BigInteger ("545"))) && 382 (in2.equals(new BigDecimal ("546.545"))) && 383 (in35.equals(expectedDateTime)) && 384 (in13.equals(new Boolean (false))) && 385 (in14.equals(new Byte ((byte) 11))) && 386 (in15.equals(new Short ((short) 45))) && 387 (in16.equals(new Integer (101))) && 388 (in17.equals(new Long (232309L))) && 389 (in18.equals(new Float (67634.12F))) && 390 (in19.equals(new Double (892387.232D))) && 391 (in4) && 392 (in5 == (byte) 2) && 393 (in6 == (short) 14) && 394 (in7 == 234) && 395 (in8 == 10900L) && 396 (in9 == 23098.23F) && 397 (in10 == 2098098.01D) && 398 (in11[0] == (byte) 5) && 399 (in11[1] == (byte) 10) && 400 (in11[2] == (byte) 12) && 401 (in12[0].equals(new Byte ((byte) 9))) && 402 (in12[1].equals(new Byte ((byte) 7))))) { 403 throw new RemoteException ("Expected values did not match actuals."); 404 } 405 406 } 408 public byte[] methodByteArray(byte[] in0) throws RemoteException { 409 410 byte[] returnByte = {(byte) 5, (byte) 4}; 411 412 if ((in0[0] == (byte) 3) && (in0[1] == (byte) 9)) { 413 return returnByte; 414 } else { 415 throw new RemoteException ("Expecting a byte array with 3 and 9."); 416 } 417 418 } 420 public Calendar methodDateTime(Calendar in0) throws RemoteException { 421 422 Calendar expectedDateTime = Calendar.getInstance(); 423 TimeZone gmt = TimeZone.getTimeZone("GMT"); 424 expectedDateTime.setTimeZone(gmt); 425 expectedDateTime.setTime(new Date (1012937861996L)); 426 427 if (in0.equals(expectedDateTime)) { 428 Calendar dateTime = Calendar.getInstance(); 429 dateTime.setTimeZone(gmt); 430 dateTime.setTime(new Date (1012937861800L)); 431 return dateTime; 432 } else { 433 throw new RemoteException ("Expecting a Date value of " + expectedDateTime + "."); 434 } 435 436 } 438 public Calendar methodDate(Calendar in0) throws RemoteException { 439 return methodDateTime(in0); 440 } 442 public BigDecimal methodBigDecimal(BigDecimal in0) throws RemoteException { 443 444 if (in0.equals(new BigDecimal ("3434.456"))) { 445 return new BigDecimal ("903483.304"); 446 } else { 447 throw new RemoteException ("Expecting a BigDecimal value of 3434.456."); 448 } 449 450 } 452 public BigInteger methodBigInteger(BigInteger in0) throws RemoteException { 453 454 if (in0.equals(new BigInteger ("8789"))) { 455 return new BigInteger ("2323"); 456 } else { 457 throw new RemoteException ("Expecting a BigInteger value of 8789."); 458 } 459 460 } 462 public String methodString(String in0) throws RemoteException { 463 464 if (in0.equals("Request")) { 465 return "Response"; 466 } else { 467 throw new RemoteException ("Expecting a string value of \"Request\""); 468 } 469 470 } 472 public double methodDouble(double in0) throws RemoteException { 473 474 if (in0 == 87502.002D) { 475 return 567.547D; 476 } else { 477 throw new RemoteException ("Expecting a double value of 87502.002D"); 478 } 479 480 } 482 public float methodFloat(float in0) throws RemoteException { 483 484 if (in0 == 8787.25F) { 485 return 12325.545F; 486 } else { 487 throw new RemoteException ("Expecting a float value of 8787.25F"); 488 } 489 490 } 492 public long methodLong(long in0) throws RemoteException { 493 494 if (in0 == 45425L) { 495 return 787985L; 496 } else { 497 throw new RemoteException ("Expecting a long value of 45425L."); 498 } 499 500 } 502 public int methodInt(int in0) throws RemoteException { 503 504 if (in0 == 1215) { 505 return 10232; 506 } else { 507 throw new RemoteException ("Expecting an int value of 1215."); 508 } 509 510 } 512 public short methodShort(short in0) throws RemoteException { 513 514 if (in0 == (short) 302) { 515 return(short) 124; 516 } else { 517 throw new RemoteException ("Expecting a short value of 302."); 518 } 519 520 } 522 public byte methodByte(byte in0) throws RemoteException { 523 524 if (in0 == (byte) 61) { 525 return(byte) 35; 526 } else { 527 throw new RemoteException ("Expecting a byte value of 61."); 528 } 529 530 } 532 public boolean methodBoolean(boolean in0) throws RemoteException { 533 534 if (in0) { 535 return false; 536 } else { 537 throw new RemoteException ("Expecting a boolean value of true."); 538 } 539 540 } 542 public CallOptions[] methodCallOptions(CallOptions[] in0) throws RemoteException { 543 Calendar dateTime = Calendar.getInstance(); 544 TimeZone gmt = TimeZone.getTimeZone("GMT"); 545 dateTime.setTimeZone(gmt); 546 dateTime.setTime(new Date (1013459984577L)); 547 if (in0[0].getCallDate().equals(dateTime)) { 548 in0[0] = new CallOptions(); 549 dateTime.setTime(new Date (1013459984507L)); 550 in0[0].setCallDate(dateTime); 551 return in0; 552 } else { 553 throw new RemoteException ("Actual value did not match expected value."); 554 } 555 556 } 558 public Float methodSoapFloat(Float in0) throws RemoteException { 559 560 if (in0.equals(new Float (23423.234F))) { 561 return new Float (232.23F); 562 } else { 563 throw new RemoteException ("Expecting a float value of 23423.234F"); 564 } 565 566 } 568 public Double methodSoapDouble(Double in0) throws RemoteException { 569 570 if (in0.equals(new Double (123423.234D))) { 571 return new Double (2232.23D); 572 } else { 573 throw new RemoteException ("Expecting a float value of 123423.234D"); 574 } 575 576 } 578 public Boolean methodSoapBoolean(Boolean in0) throws RemoteException { 579 580 if (in0.equals(new Boolean (true))) { 581 return new Boolean (false); 582 } else { 583 throw new RemoteException ("Expecting a boolean value of true"); 584 } 585 586 } 588 public Byte methodSoapByte(Byte in0) throws RemoteException { 589 590 if (in0.equals(new Byte ((byte) 9))) { 591 return new Byte ((byte) 10); 592 } else { 593 throw new RemoteException ("Expecting a byte value of 9"); 594 } 595 596 } 598 public Short methodSoapShort(Short in0) throws RemoteException { 599 600 if (in0.equals(new Short ((short) 32))) { 601 return new Short ((short) 44); 602 } else { 603 throw new RemoteException ("Expecting a short value of 32"); 604 } 605 606 } 608 public Integer methodSoapInt(Integer in0) throws RemoteException { 609 610 if (in0.equals(new Integer (332))) { 611 return new Integer (441); 612 } else { 613 throw new RemoteException ("Expecting a short value of 332"); 614 } 615 616 } 618 public Long methodSoapLong(Long in0) throws RemoteException { 619 620 if (in0.equals(new Long (3321L))) { 621 return new Long (4412L); 622 } else { 623 throw new RemoteException ("Expecting a short value of 3321L"); 624 } 625 626 } 628 public void throwInvalidTickerException() 629 throws InvalidTickerSymbol, RemoteException { 630 631 throw new InvalidTickerSymbol("ABC"); 632 633 } 635 public void throwInvalidTradeExchange() 636 throws InvalidTickerSymbol, 637 InvalidTradeExchange, 638 InvalidCompanyId, 639 RemoteException { 640 641 throw new InvalidTradeExchange("XYZ"); 642 643 } 645 public int getId(BondInvestment investment) 646 throws java.rmi.RemoteException { 647 return investment.getId(); 648 } 649 public int getId(Investment investment) 650 throws java.rmi.RemoteException { 651 return investment.getId(); 652 } 653 654 public void holderTest(StringHolder sh, BondInvestmentHolder bih) { 656 } 657 658 } | Popular Tags |