KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > roundtrip > RoundtripTestSoapBindingImpl


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package test.wsdl.roundtrip;
18
19 import test.wsdl.roundtrip.holders.BondInvestmentHolder;
20
21 import javax.xml.rpc.holders.StringHolder JavaDoc;
22 import java.math.BigDecimal JavaDoc;
23 import java.math.BigInteger JavaDoc;
24 import java.rmi.RemoteException JavaDoc;
25 import java.util.Calendar JavaDoc;
26 import java.util.Date JavaDoc;
27 import java.util.HashMap JavaDoc;
28 import java.util.TimeZone JavaDoc;
29
30 /**
31  * This class contains the implementations of the methods defined in the
32  * RoundtripPortType interface. Most of the methods compare the actual
33  * values received from the client against some expected values.
34  *
35  * @version 1.00 06 Feb 2002
36  * @author Brent Ulbricht
37  */

38 public class RoundtripTestSoapBindingImpl implements RoundtripPortType {
39
40     public float getRealtimeLastTradePrice(StockInvestment in0) throws RemoteException JavaDoc {
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 JavaDoc("Actual Value Did Not Match Expected Value.");
49         }
50
51     } // getRealtimeLastTradePrice
52

53     public PreferredStockInvestment getDividends(PreferredStockInvestment in0) throws RemoteException JavaDoc {
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 JavaDoc("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 JavaDoc("8.00"));
67             return in0;
68         } else {
69             throw new RemoteException JavaDoc("Actual Value Did Not Match Expected Value.");
70         }
71
72     } // getDividend
73

74     public BondInvestment methodBondInvestmentInOut(BondInvestment in0) throws RemoteException JavaDoc {
75
76         short[] shortArray = {(short) 36};
77         byte[] byteArray = {(byte) 7};
78         CallOptions[] callOptions = new CallOptions[2];
79         callOptions[0] = new CallOptions();
80         Calendar JavaDoc date = Calendar.getInstance();
81         TimeZone JavaDoc gmt = TimeZone.getTimeZone("GMT");
82         date.setTimeZone(gmt);
83         date.setTime(new Date JavaDoc(1013441507308L));
84         callOptions[0].setCallDate(date);
85         callOptions[1] = new CallOptions();
86         date = Calendar.getInstance();
87         date.setTimeZone(gmt);
88         date.setTime(new Date JavaDoc(1013441507328L));
89         callOptions[1].setCallDate(date);
90         HashMap JavaDoc map = new HashMap JavaDoc();
91         map.put("Test", "Test Works");
92
93         Short JavaDoc[] wrapperShortArray = {new Short JavaDoc((short) 33), new Short JavaDoc((short) 86)};
94         Byte JavaDoc[] wrapperByteArray = {new Byte JavaDoc((byte) 4), new Byte JavaDoc((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 JavaDoc(33.232D));
105         sendValue.setWrapperFloat(new Float JavaDoc(2.23F));
106         sendValue.setWrapperInteger(new Integer JavaDoc(3));
107         sendValue.setWrapperShort(new Short JavaDoc((short) 2));
108         sendValue.setWrapperByte(new Byte JavaDoc((byte) 21));
109         sendValue.setWrapperBoolean(new Boolean JavaDoc(false));
110         sendValue.setShortArray(shortArray);
111         sendValue.setByteArray(byteArray);
112         date = Calendar.getInstance();
113         date.setTimeZone(gmt);
114         date.setTime(new Date JavaDoc(1012937862997L));
115         sendValue.setCallableDate(date);
116         sendValue.setBondAmount(new BigDecimal JavaDoc("2735.23"));
117         sendValue.setPortfolioType(new BigInteger JavaDoc("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 JavaDoc("Actual attribute values did not match expected values.");
132
133         Calendar JavaDoc expectedDate0 = Calendar.getInstance();
134         expectedDate0.setTimeZone(gmt);
135         expectedDate0.setTime(new Date JavaDoc(1013441507388L));
136         Calendar JavaDoc expectedDate1 = Calendar.getInstance();
137         expectedDate1.setTimeZone(gmt);
138         expectedDate1.setTime(new Date JavaDoc(1013441507390L));
139         Calendar JavaDoc expectedDate2 = Calendar.getInstance();
140         expectedDate2.setTimeZone(gmt);
141         expectedDate2.setTime(new Date JavaDoc(1013441507388L));
142         Calendar JavaDoc expectedDate3 = Calendar.getInstance();
143         expectedDate3.setTimeZone(gmt);
144         expectedDate3.setTime(new Date JavaDoc(1013441507390L));
145         Calendar JavaDoc expectedDate4 = Calendar.getInstance();
146         expectedDate4.setTimeZone(gmt);
147         expectedDate4.setTime(new Date JavaDoc(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 JavaDoc((short) 23))) &&
154             (in0.getWrapperShortArray()[1].equals(new Short JavaDoc((short) 56))) &&
155             (in0.getWrapperByteArray()[0].equals(new Byte JavaDoc((byte) 2))) &&
156             (in0.getWrapperByteArray()[1].equals(new Byte JavaDoc((byte) 15))) &&
157             (in0.getWrapperDouble().equals(new Double JavaDoc(2323.232D))) &&
158             (in0.getWrapperFloat().equals(new Float JavaDoc(23.023F))) &&
159             (in0.getWrapperInteger().equals(new Integer JavaDoc(2093))) &&
160             (in0.getWrapperShort().equals(new Short JavaDoc((short) 203))) &&
161             (in0.getWrapperByte().equals(new Byte JavaDoc((byte) 20))) &&
162             (in0.getWrapperBoolean().equals(new Boolean JavaDoc(true))) &&
163             (in0.getShortArray()[0] == (short) 30) &&
164             (in0.getByteArray()[0] == (byte) 1) &&
165             (in0.getCallableDate().equals(expectedDate4)) &&
166             (in0.getBondAmount().equals(new BigDecimal JavaDoc("2675.23"))) &&
167             (in0.getPortfolioType().equals(new BigInteger JavaDoc("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 JavaDoc("Actual values did not match expected values.");
178         }
179
180     } // methodBondInvestmentInOut
181

182     public BondInvestment methodBondInvestmentOut() throws RemoteException JavaDoc {
183
184         short[] shortArray = {(short) 36};
185         byte[] byteArray = {(byte) 7};
186         CallOptions[] callOptions = new CallOptions[2];
187         callOptions[0] = new CallOptions();
188         Calendar JavaDoc date = Calendar.getInstance();
189         TimeZone JavaDoc gmt = TimeZone.getTimeZone("GMT");
190         date.setTimeZone(gmt);
191         date.setTime(new Date JavaDoc(1013441507308L));
192         callOptions[0].setCallDate(date);
193         callOptions[1] = new CallOptions();
194         date = Calendar.getInstance();
195         date.setTimeZone(gmt);
196         date.setTime(new Date JavaDoc(1013441507328L));
197         callOptions[1].setCallDate(date);
198         Short JavaDoc[] wrapperShortArray = {new Short JavaDoc((short) 33), new Short JavaDoc((short) 86)};
199         Byte JavaDoc[] wrapperByteArray = {new Byte JavaDoc((byte) 4), new Byte JavaDoc((byte) 18)};
200         HashMap JavaDoc map = new HashMap JavaDoc();
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 JavaDoc(33.232D));
213         sendValue.setWrapperFloat(new Float JavaDoc(2.23F));
214         sendValue.setWrapperInteger(new Integer JavaDoc(3));
215         sendValue.setWrapperShort(new Short JavaDoc((short) 2));
216         sendValue.setWrapperByte(new Byte JavaDoc((byte) 21));
217         sendValue.setWrapperBoolean(new Boolean JavaDoc(false));
218         sendValue.setShortArray(shortArray);
219         sendValue.setByteArray(byteArray);
220         date = Calendar.getInstance();
221         date.setTimeZone(gmt);
222         date.setTime(new Date JavaDoc(1012937862997L));
223         sendValue.setCallableDate(date);
224         sendValue.setBondAmount(new BigDecimal JavaDoc("2735.23"));
225         sendValue.setPortfolioType(new BigInteger JavaDoc("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     } // methodBondInvestmentOut
237

238     public void methodBondInvestmentIn(BondInvestment in0) throws RemoteException JavaDoc {
239         Calendar JavaDoc expectedDate0 = Calendar.getInstance();
240         TimeZone JavaDoc gmt = TimeZone.getTimeZone("GMT");
241         expectedDate0.setTimeZone(gmt);
242         expectedDate0.setTime(new Date JavaDoc(1013441507388L));
243         Calendar JavaDoc expectedDate1 = Calendar.getInstance();
244         expectedDate1.setTimeZone(gmt);
245         expectedDate1.setTime(new Date JavaDoc(1013441507390L));
246         Calendar JavaDoc expectedDate2 = Calendar.getInstance();
247         expectedDate2.setTimeZone(gmt);
248         expectedDate2.setTime(new Date JavaDoc(1013441507388L));
249         Calendar JavaDoc expectedDate3 = Calendar.getInstance();
250         expectedDate3.setTimeZone(gmt);
251         expectedDate3.setTime(new Date JavaDoc(1013441507390L));
252         Calendar JavaDoc expectedDate4 = Calendar.getInstance();
253         expectedDate4.setTimeZone(gmt);
254         expectedDate4.setTime(new Date JavaDoc(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 JavaDoc((short) 23))) &&
261               (in0.getWrapperShortArray()[1].equals(new Short JavaDoc((short) 56))) &&
262               (in0.getWrapperByteArray()[0].equals(new Byte JavaDoc((byte) 2))) &&
263               (in0.getWrapperByteArray()[1].equals(new Byte JavaDoc((byte) 15))) &&
264               (in0.getWrapperDouble().equals(new Double JavaDoc(2323.232D))) &&
265               (in0.getWrapperFloat().equals(new Float JavaDoc(23.023F))) &&
266               (in0.getWrapperInteger().equals(new Integer JavaDoc(2093))) &&
267               (in0.getWrapperShort().equals(new Short JavaDoc((short) 203))) &&
268               (in0.getWrapperByte().equals(new Byte JavaDoc((byte) 20))) &&
269               (in0.getWrapperBoolean().equals(new Boolean JavaDoc(true))) &&
270               (in0.getShortArray()[0] == (short) 30) &&
271               (in0.getByteArray()[0] == (byte) 1) &&
272               (in0.getCallableDate().equals(expectedDate4)) &&
273               (in0.getBondAmount().equals(new BigDecimal JavaDoc("2675.23"))) &&
274               (in0.getPortfolioType().equals(new BigInteger JavaDoc("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 JavaDoc("Actual values did not match expected values.");
283         }
284
285     } // methodBondInvestmentIn
286

287     public String JavaDoc[][] methodStringMArrayOut() throws RemoteException JavaDoc {
288
289         String JavaDoc[][] sendArray = { {"Out-0-0"}, {"Out-1-0"}};
290         return sendArray;
291
292     } // methodStringMArrayOut
293

294     public void methodStringMArrayIn(String JavaDoc[][] in0) throws RemoteException JavaDoc {
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 JavaDoc("The actual values did not match expected values.");
301         }
302
303     } // methodStringMArrayIn
304

305     public String JavaDoc[][] methodStringMArrayInOut(String JavaDoc[][] in0) throws RemoteException JavaDoc {
306
307         String JavaDoc[][] 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 JavaDoc("The actual values did not match expected values.");
316         }
317
318     } // methodStringMArrayInOut
319

320     public int[] methodIntArrayOut() throws RemoteException JavaDoc {
321
322         int[] returnByteArray = {3, 78, 102};
323         return returnByteArray;
324
325     } // methodIntArrayOut
326

327     public void methodIntArrayIn(int[] in0) throws RemoteException JavaDoc {
328
329         if (!((in0[0] == 91) &&
330               (in0[1] == 54) &&
331               (in0[2] == 47) &&
332               (in0[3] == 10))) {
333             throw new RemoteException JavaDoc("The actual values did not match expected values.");
334         }
335
336     } // methodIntArrayIn
337

338     public int[] methodIntArrayInOut(int[] in0) throws RemoteException JavaDoc {
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 JavaDoc("The actual values did not match expected values.");
351         }
352
353     } // methodIntArrayIn
354

355     public void methodAllTypesIn(String JavaDoc in0,
356                                  BigInteger JavaDoc in1,
357                                  BigDecimal JavaDoc in2,
358                                  Calendar JavaDoc in35,
359                                  Calendar JavaDoc 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 JavaDoc in13,
369                                  Byte JavaDoc in14,
370                                  Short JavaDoc in15,
371                                  Integer JavaDoc in16,
372                                  Long JavaDoc in17,
373                                  Float JavaDoc in18,
374                                  Double JavaDoc in19,
375                                  Byte JavaDoc[] in12) throws RemoteException JavaDoc {
376         Calendar JavaDoc expectedDateTime = Calendar.getInstance();
377         TimeZone JavaDoc gmt = TimeZone.getTimeZone("GMT");
378         expectedDateTime.setTimeZone(gmt);
379         expectedDateTime.setTime(new Date JavaDoc(1012937861986L));
380         if (!((in0.equals(new String JavaDoc("Request methodAllTypesIn"))) &&
381               (in1.equals(new BigInteger JavaDoc("545"))) &&
382               (in2.equals(new BigDecimal JavaDoc("546.545"))) &&
383               (in35.equals(expectedDateTime)) &&
384               (in13.equals(new Boolean JavaDoc(false))) &&
385               (in14.equals(new Byte JavaDoc((byte) 11))) &&
386               (in15.equals(new Short JavaDoc((short) 45))) &&
387               (in16.equals(new Integer JavaDoc(101))) &&
388               (in17.equals(new Long JavaDoc(232309L))) &&
389               (in18.equals(new Float JavaDoc(67634.12F))) &&
390               (in19.equals(new Double JavaDoc(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 JavaDoc((byte) 9))) &&
402               (in12[1].equals(new Byte JavaDoc((byte) 7))))) {
403             throw new RemoteException JavaDoc("Expected values did not match actuals.");
404         }
405
406     } // methodAllTypesIn
407

408     public byte[] methodByteArray(byte[] in0) throws RemoteException JavaDoc {
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 JavaDoc("Expecting a byte array with 3 and 9.");
416         }
417
418     } // methodByteArray
419

420     public Calendar JavaDoc methodDateTime(Calendar JavaDoc in0) throws RemoteException JavaDoc {
421
422         Calendar JavaDoc expectedDateTime = Calendar.getInstance();
423         TimeZone JavaDoc gmt = TimeZone.getTimeZone("GMT");
424         expectedDateTime.setTimeZone(gmt);
425         expectedDateTime.setTime(new Date JavaDoc(1012937861996L));
426
427         if (in0.equals(expectedDateTime)) {
428             Calendar JavaDoc dateTime = Calendar.getInstance();
429             dateTime.setTimeZone(gmt);
430             dateTime.setTime(new Date JavaDoc(1012937861800L));
431             return dateTime;
432         } else {
433             throw new RemoteException JavaDoc("Expecting a Date value of " + expectedDateTime + ".");
434         }
435
436     } // methodDateTime
437

438     public Calendar JavaDoc methodDate(Calendar JavaDoc in0) throws RemoteException JavaDoc {
439         return methodDateTime(in0);
440     } // methodDate
441

442     public BigDecimal JavaDoc methodBigDecimal(BigDecimal JavaDoc in0) throws RemoteException JavaDoc {
443
444         if (in0.equals(new BigDecimal JavaDoc("3434.456"))) {
445             return new BigDecimal JavaDoc("903483.304");
446         } else {
447             throw new RemoteException JavaDoc("Expecting a BigDecimal value of 3434.456.");
448         }
449
450     } // methodBigDecimal
451

452     public BigInteger JavaDoc methodBigInteger(BigInteger JavaDoc in0) throws RemoteException JavaDoc {
453
454         if (in0.equals(new BigInteger JavaDoc("8789"))) {
455             return new BigInteger JavaDoc("2323");
456         } else {
457             throw new RemoteException JavaDoc("Expecting a BigInteger value of 8789.");
458         }
459
460     } // methodBigInteger
461

462     public String JavaDoc methodString(String JavaDoc in0) throws RemoteException JavaDoc {
463
464         if (in0.equals("Request")) {
465             return "Response";
466         } else {
467             throw new RemoteException JavaDoc("Expecting a string value of \"Request\"");
468         }
469
470     } // methodString
471

472     public double methodDouble(double in0) throws RemoteException JavaDoc {
473
474         if (in0 == 87502.002D) {
475             return 567.547D;
476         } else {
477             throw new RemoteException JavaDoc("Expecting a double value of 87502.002D");
478         }
479
480     } // methodDouble
481

482     public float methodFloat(float in0) throws RemoteException JavaDoc {
483
484         if (in0 == 8787.25F) {
485             return 12325.545F;
486         } else {
487             throw new RemoteException JavaDoc("Expecting a float value of 8787.25F");
488         }
489
490     } // methodFloat
491

492     public long methodLong(long in0) throws RemoteException JavaDoc {
493
494         if (in0 == 45425L) {
495             return 787985L;
496         } else {
497             throw new RemoteException JavaDoc("Expecting a long value of 45425L.");
498         }
499
500     } // methodLong
501

502     public int methodInt(int in0) throws RemoteException JavaDoc {
503
504         if (in0 == 1215) {
505             return 10232;
506         } else {
507             throw new RemoteException JavaDoc("Expecting an int value of 1215.");
508         }
509
510     } // methodInt
511

512     public short methodShort(short in0) throws RemoteException JavaDoc {
513
514         if (in0 == (short) 302) {
515             return(short) 124;
516         } else {
517             throw new RemoteException JavaDoc("Expecting a short value of 302.");
518         }
519
520     } // methodShort
521

522     public byte methodByte(byte in0) throws RemoteException JavaDoc {
523
524         if (in0 == (byte) 61) {
525             return(byte) 35;
526         } else {
527             throw new RemoteException JavaDoc("Expecting a byte value of 61.");
528         }
529
530     } // methodByte
531

532     public boolean methodBoolean(boolean in0) throws RemoteException JavaDoc {
533
534         if (in0) {
535             return false;
536         } else {
537             throw new RemoteException JavaDoc("Expecting a boolean value of true.");
538         }
539
540     } // methodBoolean
541

542     public CallOptions[] methodCallOptions(CallOptions[] in0) throws RemoteException JavaDoc {
543         Calendar JavaDoc dateTime = Calendar.getInstance();
544         TimeZone JavaDoc gmt = TimeZone.getTimeZone("GMT");
545         dateTime.setTimeZone(gmt);
546         dateTime.setTime(new Date JavaDoc(1013459984577L));
547         if (in0[0].getCallDate().equals(dateTime)) {
548             in0[0] = new CallOptions();
549             dateTime.setTime(new Date JavaDoc(1013459984507L));
550             in0[0].setCallDate(dateTime);
551             return in0;
552         } else {
553             throw new RemoteException JavaDoc("Actual value did not match expected value.");
554         }
555
556     } // methodCallOptions
557

558     public Float JavaDoc methodSoapFloat(Float JavaDoc in0) throws RemoteException JavaDoc {
559
560         if (in0.equals(new Float JavaDoc(23423.234F))) {
561             return new Float JavaDoc(232.23F);
562         } else {
563             throw new RemoteException JavaDoc("Expecting a float value of 23423.234F");
564         }
565
566     } // methodSoapFloat
567

568     public Double JavaDoc methodSoapDouble(Double JavaDoc in0) throws RemoteException JavaDoc {
569
570         if (in0.equals(new Double JavaDoc(123423.234D))) {
571             return new Double JavaDoc(2232.23D);
572         } else {
573             throw new RemoteException JavaDoc("Expecting a float value of 123423.234D");
574         }
575
576     } // methodSoapDouble
577

578     public Boolean JavaDoc methodSoapBoolean(Boolean JavaDoc in0) throws RemoteException JavaDoc {
579
580         if (in0.equals(new Boolean JavaDoc(true))) {
581             return new Boolean JavaDoc(false);
582         } else {
583             throw new RemoteException JavaDoc("Expecting a boolean value of true");
584         }
585
586     } // methodSoapBoolean
587

588     public Byte JavaDoc methodSoapByte(Byte JavaDoc in0) throws RemoteException JavaDoc {
589
590         if (in0.equals(new Byte JavaDoc((byte) 9))) {
591             return new Byte JavaDoc((byte) 10);
592         } else {
593             throw new RemoteException JavaDoc("Expecting a byte value of 9");
594         }
595
596     } // methodSoapByte
597

598     public Short JavaDoc methodSoapShort(Short JavaDoc in0) throws RemoteException JavaDoc {
599
600         if (in0.equals(new Short JavaDoc((short) 32))) {
601             return new Short JavaDoc((short) 44);
602         } else {
603             throw new RemoteException JavaDoc("Expecting a short value of 32");
604         }
605
606     } // methodSoapShort
607

608     public Integer JavaDoc methodSoapInt(Integer JavaDoc in0) throws RemoteException JavaDoc {
609
610         if (in0.equals(new Integer JavaDoc(332))) {
611             return new Integer JavaDoc(441);
612         } else {
613             throw new RemoteException JavaDoc("Expecting a short value of 332");
614         }
615
616     } // methodSoapInt
617

618     public Long JavaDoc methodSoapLong(Long JavaDoc in0) throws RemoteException JavaDoc {
619
620         if (in0.equals(new Long JavaDoc(3321L))) {
621             return new Long JavaDoc(4412L);
622         } else {
623             throw new RemoteException JavaDoc("Expecting a short value of 3321L");
624         }
625
626     } // methodSoapLong
627

628     public void throwInvalidTickerException()
629         throws InvalidTickerSymbol, RemoteException JavaDoc {
630
631         throw new InvalidTickerSymbol("ABC");
632
633     } // throwInvalidTickerSymbol
634

635     public void throwInvalidTradeExchange()
636           throws InvalidTickerSymbol,
637                  InvalidTradeExchange,
638                  InvalidCompanyId,
639                  RemoteException JavaDoc {
640
641         throw new InvalidTradeExchange("XYZ");
642
643     } // throwInvalidTradeExchange
644

645     public int getId(BondInvestment investment)
646         throws java.rmi.RemoteException JavaDoc {
647         return investment.getId();
648     }
649     public int getId(Investment investment)
650         throws java.rmi.RemoteException JavaDoc {
651         return investment.getId();
652     }
653
654     // This is a compile-time test, so we don't need any runtime test code.
655
public void holderTest(StringHolder JavaDoc sh, BondInvestmentHolder bih) {
656     }
657
658 } // End class RoundtripTypesTestSoapBindingImpl
659
Popular Tags