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.faultsservice;
20:
21: import javax.xml.ws.WebFault;
22:
23: /**
24: * This is an example of a legacy exception which may be the result of a JAX-RPC emission.
25: * The fault does not have the valid constructors and lacks a getFaultInfo method.
26: * However (in this case) the fault has a @WebFault that identifies the faultbean
27: */
28: @WebFault(name="InvalidTickerFault",targetNamespace="http://org/test/polymorphicfaults",faultBean="org.test.polymorphicfaults.InvalidTickerFaultExceptionBean")
29: // faultBean is intentionally not specified. It should default to
30: // faultBean="org.test.polymorphicfaults.InvalidTickerFault_ExceptionBean"
31: public class InvalidTickerFault_Exception extends Exception {
32:
33: /**
34: * Java type that goes as soapenv:Fault detail element.
35: *
36: */
37: private String legacyData1;
38: private int legacyData2;
39:
40: /**
41: *
42: * @param message
43: * @param faultInfo
44: */
45: public InvalidTickerFault_Exception(String message,
46: String legacyData1, int legacyData2) {
47: super (message);
48: this .legacyData1 = legacyData1;
49: this .legacyData2 = legacyData2;
50: }
51:
52: /**
53: *
54: * @param cause
55: * @param message
56: * @param faultInfo
57: */
58: public InvalidTickerFault_Exception(String message,
59: String legacyData1, int legacyData2, Throwable cause) {
60: super (message, cause);
61: this .legacyData1 = legacyData1;
62: this .legacyData2 = legacyData2;
63: }
64:
65: public String getLegacyData1() {
66: return legacyData1;
67: }
68:
69: public int getLegacyData2() {
70: return legacyData2;
71: }
72:
73: }
|