1 /* 2 * Copyright 2007 the original author or authors. 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 org.springframework.ws.soap.server.endpoint.annotation; 18 19 import java.lang.annotation.Documented; 20 import java.lang.annotation.ElementType; 21 import java.lang.annotation.Inherited; 22 import java.lang.annotation.Retention; 23 import java.lang.annotation.RetentionPolicy; 24 import java.lang.annotation.Target; 25 import javax.xml.namespace.QName; 26 27 /** 28 * Marks an exception class with the fault elements that should be returned whenever this exception is thrown. 29 * 30 * @author Arjen Poutsma 31 * @see org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver 32 * @since 1.0.0 33 */ 34 @Target(ElementType.TYPE) 35 @Retention(RetentionPolicy.RUNTIME) 36 @Documented 37 @Inherited 38 public @interface SoapFault { 39 40 /** The fault code. */ 41 FaultCode faultCode(); 42 43 /** 44 * The custom fault code, to be used if {@link #faultCode()} is set to {@link FaultCode#CUSTOM}. 45 * <p/> 46 * The format used is that of {@link QName#toString()}, i.e. "{" + Namespace URI + "}" + local part, where the 47 * namespace is optional. 48 * <p/> 49 * Note that custom Fault Codes are only supported on SOAP 1.1. 50 */ 51 String customFaultCode() default ""; 52 53 /** The fault string or reason text. By default, it is set to the exception message. */ 54 String faultStringOrReason() default ""; 55 56 /** The fault string locale. By default, it is English. */ 57 String locale() default "en"; 58 59 60 }