01: /*
02: * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
03: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
04: */
05:
06: package javax.xml.ws;
07:
08: import java.lang.annotation.Documented;
09: import java.lang.annotation.Target;
10: import java.lang.annotation.ElementType;
11: import java.lang.annotation.Retention;
12: import java.lang.annotation.RetentionPolicy;
13: import javax.xml.bind.JAXBContext;
14: import javax.xml.namespace.QName;
15: import javax.xml.ws.spi.WebServiceFeatureAnnotation;
16:
17: /**
18: * This feature clarifies the use of the <code>wsdl:binding</code>
19: * in a JAX-WS runtime.
20: * <p>
21: * This feature is only useful with web services that have an
22: * associated WSDL. Enabling this feature requires that a JAX-WS
23: * implementation inspect the <code>wsdl:binding</code> for an
24: * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
25: * that have the <code>required</code> attribute set to <code>true</code>
26: * are understood and are being used.
27: * <p>
28: * The following describes the affects of this feature with respect
29: * to be enabled or disabled:
30: * <ul>
31: * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
32: * required <code>wsdl:binding</code> extensions are either understood
33: * and used by the runtime, or explicitly disabled by the web service
34: * application. A web service application can disable a particular
35: * extension that has a known WebServiceFeature using either the appropriate
36: * annotation associated with that WebServiceFeature on the server, or one of
37: * the following methods on the client:
38: * <ul>
39: * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
40: * <li>{@link Service#getPort(Class,WebServiceFeature...)}
41: * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
42: * <li>{@link Service#createDispatch(QName,Class,Service.Mode mode,WebServiceFeature...)}
43: * <li>{@link Service#createDispatch(EndpointReference,Class,Service.Mode,WebServiceFeature...)}
44: * <li>{@link Service#createDispatch(QName,JAXBContext,Service.Mode,WebServiceFeature...)}
45: * <li>{@link Service#createDispatch(EndpointReference,JAXBContext,Service.Mode,WebServiceFeature...)}
46: * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
47: * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
48: * generated <code>Service</code>.
49: * </ul>
50: * The runtime MUST also make sure that binding of
51: * SEI parameters/return values respect the <code>wsdl:binding</code>.
52: * With this feature enabled, if a required (<code>wsdl:required="true"</code>)
53: * <code>wsdl:binding</code> extension is in the WSDL and it is not
54: * supported by a JAX-WS runtime and it has not
55: * been explicitly turned off by the web service developer, then
56: * that JAX-WS runtime MUST behave appropriately based on whether it is
57: * on the client or server:
58: * <UL>
59: * <li>Client: runtime MUST throw a
60: * <code>WebServiceException</code> no sooner than when one of the methods
61: * above is invoked but no later than the first invocation of an endpoint
62: * operation.
63: * <li>Server: throw a WebServiceException and the endpoint MUST fail to deploy
64: * </ul>
65: * <li> DISABLED: In this Mode, an implementation may choose whether
66: * to inspect the <code>wsdl:binding<code> or not and to what degree
67: * the <code>wsdl:binding</code> will be inspected. For example,
68: * one implementation may choose to behave as if this feature is enabled,
69: * another implementation may only choose to verify the SEI's
70: * parameter/return type bindings.
71: * </ul>
72: *
73: * @see javax.xml.ws.RespectBindingFeature
74: *
75: * @since JAX-WS 2.1
76: */
77: @Target(ElementType.TYPE)
78: @Retention(RetentionPolicy.RUNTIME)
79: @Documented
80: @WebServiceFeatureAnnotation(id=RespectBindingFeature.ID,bean=RespectBindingFeature.class)
81: public @interface RespectBinding {
82: /**
83: * Specifies if this feature is enabled or disabled.
84: */
85: boolean enabled() default true;
86: }
|