01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.jaxws.sample.dlwmin;
20:
21: import org.apache.axis2.jaxws.sample.dlwmin.sei.Greeter;
22: import org.apache.axis2.jaxws.sample.dlwmin.sei.TestException;
23: import org.apache.axis2.jaxws.sample.dlwmin.sei.TestException2;
24: import org.apache.axis2.jaxws.sample.dlwmin.sei.TestException3;
25: import org.apache.axis2.jaxws.sample.dlwmin.types.ProcessFault3;
26: import org.apache.axis2.jaxws.sample.dlwmin.types.TestBean;
27:
28: import javax.jws.WebService;
29: import javax.xml.ws.WebServiceException;
30:
31: @WebService(endpointInterface="org.apache.axis2.jaxws.sample.dlwmin.sei.Greeter",targetNamespace="http://apache.org/axis2/jaxws/sample/dlwmin")
32: public class GreeterImpl implements Greeter {
33:
34: public String greetMe(String me) {
35: return "Hello " + me;
36: }
37:
38: public String testUnqualified(String in) {
39: return in;
40: }
41:
42: public TestBean process(int inAction, TestBean in)
43: throws TestException, TestException2, TestException3 {
44: if (inAction == 0) {
45: // echo
46: return in;
47: } else if (inAction == 1) {
48: // throw checked exception that does not have a fault bean
49: throw new TestException("TestException thrown", 123);
50: } else if (inAction == 2) {
51: throw new WebServiceException("WebServiceException thrown");
52: } else if (inAction == 3) {
53: throw new NullPointerException("NPE thrown");
54: } else if (inAction == 4) {
55: // throw checked exception that does have a fault bean
56: throw new TestException2("TestException2 thrown", 456);
57: } else if (inAction == 5) {
58: // throw checked exception that does have a fault bean
59: ProcessFault3 faultInfo = new ProcessFault3();
60: faultInfo.setFlag(789);
61: throw new TestException3("TestException3 thrown", faultInfo);
62: }
63: return null;
64: }
65:
66: }
|