KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > ws > RespectBinding


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

78 @Target JavaDoc(ElementType.TYPE)
79 @Retention JavaDoc(RetentionPolicy.RUNTIME)
80 @Documented JavaDoc
81 @WebServiceFeatureAnnotation(id=RespectBindingFeature.ID,bean=RespectBindingFeature.class)
82 public @interface RespectBinding {
83     /**
84      * Specifies if this feature is enabled or disabled.
85      */

86     boolean enabled() default true;
87 }
88
Popular Tags