1 /* 2 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 3 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 */ 5 6 package javax.xml.ws.soap; 7 8 import java.lang.annotation.Documented; 9 import java.lang.annotation.Target; 10 import java.lang.annotation.ElementType; 11 import java.lang.annotation.Retention; 12 import java.lang.annotation.RetentionPolicy; 13 14 15 import javax.xml.ws.Action; 16 import javax.xml.ws.BindingProvider; 17 import javax.xml.ws.FaultAction; 18 import javax.xml.ws.spi.WebServiceFeatureAnnotation; 19 20 21 /** 22 * <p> 23 * This feature represents the use of WS-Addressing with either 24 * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding. Using this feature 25 * with any other binding is NOT required. 26 * <p> 27 * The following describes the effects of this feature with respect 28 * to be enabled or disabled: 29 * <ul> 30 * <li> ENABLED: In this Mode, WS-Addressing will be enabled. 31 * At runtime, WS-Addressing headers 32 * MUST be consumed by the receiver and produced by the 33 * sender even if the WSDL declares otherwise. The 34 * mustUnderstand="0" attribute MUST be used on the response WS-Addressing 35 * headers. 36 * <li> DISABLED: In this Mode, WS-Addressing will be disabled 37 * even if an associated WSDL specifies otherwise. At runtime, 38 * WS-Addressing headers MUST NOT be used. WS-Addressing may be explicitly 39 * disabled to prevent a JAX-WS implementation from consuming and producing 40 * WS-Addressing headers. If an application 41 * has implemented WS-Addressing itself, it MUST explicitly disable this feature. 42 * Not doing so may break compatibility with future versions of JAX-WS. 43 * </ul> 44 * <p> 45 * The <code>required</code> property can be used to 46 * specify if WS-Addressing headers MUST 47 * be present on incoming messages. By default the 48 * <code>required</code> property is <code>false</code>. 49 * <p> 50 * The definition of this annotation is incomplete in this release of JAX-WS as 51 * there is no standard way to convey the use of WS-Addressing via a WSDL and there is no 52 * standard definition for the default value of WS-Addressing <code>Action</code> headers; 53 * however, the runtime behavior of this annotation is well-defined. 54 * It is intended that a future version of 55 * JAX-WS will require the use of the standard mechanism to convey the use 56 * of WS-Addressing via WSDL and default values for WS-Addressing <code>Action</code> headers 57 * as defined by the W3C WG on WS-Addressing. 58 * <p> 59 * To write a portable endpoint and its corresponding client with this version of JAX-WS, 60 * an endpoint MUST explicitly specify what WS-Addressing <code>Actions</code> are to be used 61 * via the {@link Action} and {@link FaultAction} annotations. The client MUST explicitly 62 * enable addresssing via the {@link AddressingFeature}, and for each invocation, the client 63 * MUST explicitly set the {@link BindingProvider#SOAPACTION_URI_PROPERTY}. 64 * After the W3C WG on WS-Addressing has specified how the use of WS-Addressing is specified in the WSDL, 65 * and what the default value must be for Action headers, a future version of JAX-WS will remove these requirements. 66 * <p> 67 * See <a HREF="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">Web Services Addressing - Core</a> 68 * and <a HREF="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a> 69 * for more information on WS-Addressing. 70 * 71 * @since JAX-WS 2.1 72 */ 73 @Target(ElementType.TYPE) 74 @Retention(RetentionPolicy.RUNTIME) 75 @Documented 76 @WebServiceFeatureAnnotation(id=AddressingFeature.ID,bean=AddressingFeature.class) 77 public @interface Addressing { 78 /** 79 * Specifies if this feature is enabled or disabled. 80 */ 81 boolean enabled() default true; 82 83 /** 84 * Property to determine if WS-Addressing headers MUST 85 * be present on incoming messages. 86 */ 87 boolean required() default false; 88 } 89