1 /*
2 * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3 * the spring framework, http://el4j.sf.net
4 * Copyright (C) 2005 by ELCA Informatique SA, Av. de la Harpe 22-24,
5 * 1000 Lausanne, Switzerland, http://www.elca.ch
6 *
7 * EL4J is published under the GNU Lesser General Public License (LGPL)
8 * Version 2.1. See http://www.gnu.org/licenses/
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * For alternative licensing, please contact info@elca.ch
16 */
17 package ch.elca.el4j.tests.remoting.jaxws.service.impl;
18
19 import javax.jws.WebService;
20
21 import ch.elca.el4j.tests.remoting.jaxws.service.CalculatorCopy;
22 import ch.elca.el4j.tests.remoting.jaxws.service.CalculatorException;
23 import ch.elca.el4j.tests.remoting.jaxws.service.CalculatorValueObject;
24 import ch.elca.el4j.tests.remoting.jaxws.service.SpecialCalculatorException;
25
26 /**
27 *
28 * This class is an additional annotated version of {@link CalculatorImpl} (just to test a second service).
29 *
30 * @svnLink $Revision: 3873 $;$Date: 2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) $;$Author: swismer $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/tests/remoting_jaxws/jar-wsgen/src/main/java/ch/elca/el4j/tests/remoting/jaxws/service/impl/CalculatorCopyImplJaxws.java $
31 *
32 * @author Stefan Wismer (SWI)
33 *
34 *
35 * Recommended naming convention:
36 * name = name of implemented core interface
37 * serviceName = name of implemented core interface + "Service"
38 */
39 @WebService(name = "CalculatorCopy",
40 serviceName = "CalculatorCopyService",
41 targetNamespace = "http://webservice.jaxws.remoting.tests.el4j.elca.ch/")
42 public class CalculatorCopyImplJaxws implements CalculatorCopy {
43
44 /**
45 * {@inheritDoc}
46 */
47 public int countNumberOfUppercaseLetters(String text) {
48 if (text == null) {
49 return 0;
50 }
51
52 int numberOfUppercaseLetters = 0;
53 char[] c = text.toCharArray();
54 for (int i = 0; i < c.length; i++) {
55 if (c[i] >= 'A' && c[i] <= 'Z') {
56 numberOfUppercaseLetters++;
57 }
58 }
59 return numberOfUppercaseLetters;
60 }
61
62 /**
63 * {@inheritDoc}
64 */
65 public CalculatorValueObject echoValueObject(
66 CalculatorValueObject valueObject) {
67
68 return valueObject;
69 }
70
71 /**
72 * {@inheritDoc}
73 */
74 public double getArea(double a, double b) {
75 return a * b;
76 }
77
78 /**
79 * {@inheritDoc}
80 */
81 public void throwMeASpecialException(
82 String action) throws SpecialCalculatorException {
83 throw new SpecialCalculatorException(action);
84 }
85
86 /**
87 * {@inheritDoc}
88 */
89 public void throwMeAnException() throws CalculatorException {
90 throw new CalculatorException();
91 }
92
93 }