001: /*
002: * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
003: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
004: */
005:
006: package javax.xml.ws;
007:
008: import javax.xml.bind.JAXBContext;
009: import javax.xml.namespace.QName;
010: import javax.xml.ws.WebServiceFeature;
011: import javax.xml.ws.WebServiceException;
012: import javax.xml.ws.spi.Provider;
013:
014: /**
015: * This feature clarifies the use of the <code>wsdl:binding</code>
016: * in a JAX-WS runtime.
017: * <p>
018: * This feature is only useful with web services that have an
019: * associated WSDL. Enabling this feature requires that a JAX-WS
020: * implementation inspect the <code>wsdl:binding</code> for an
021: * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
022: * that have the <code>required</code> attribute set to <code>true</code>
023: * are understood and are being used.
024: * <p>
025: * The following describes the affects of this feature with respect
026: * to be enabled or disabled:
027: * <ul>
028: * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
029: * required <code>wsdl:binding</code> extensions are either understood
030: and used by the runtime, or explicitly disabled by the web service
031: * application. A web service application can disable a particular
032: * extension that has a known WebServiceFeature using either the appropriate
033: * annotation associated with that WebServiceFeature on the server, or one of
034: * the following methods on the client:
035: * <ul>
036: * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
037: * <li>{@link Service#getPort(Class,WebServiceFeature...)}
038: * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
039: * <li>{@link Service#createDispatch(QName,Class,Service.Mode mode,WebServiceFeature...)}
040: * <li>{@link Service#createDispatch(EndpointReference,Class,Service.Mode,WebServiceFeature...)}
041: * <li>{@link Service#createDispatch(QName,JAXBContext,Service.Mode,WebServiceFeature...)}
042: * <li>{@link Service#createDispatch(EndpointReference,JAXBContext,Service.Mode,WebServiceFeature...)}
043: * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
044: * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
045: * generated <code>Service</code>.
046: * </ul>
047: * The runtime MUST also make sure that binding of
048: * SEI parameters/return values respect the <code>wsdl:binding</code>.
049: * With this feature enabled, if a required (<code>wsdl:required="true"</code>)
050: * <code>wsdl:binding</code> extension is in the WSDL and it is not
051: * supported by a JAX-WS runtime and it has not
052: * been explicitly turned off by the web service developer, then
053: * that JAX-WS runtime MUST behave appropriately based on whether it is
054: * on the client or server:
055: * <UL>
056: * <li>Client: runtime MUST throw a
057: * <code>WebServiceException</code> no sooner than when one of the methods
058: * above is invoked but no later than the first invocation of an endpoint
059: * operation.
060: * <li>Server: throw a WebServiceException and the endpoint MUST fail to deploy
061: * </ul>
062: * <li> DISABLED: In this Mode, an implementation may choose whether
063: * to inspect the <code>wsdl:binding<code> or not and to what degree
064: * the <code>wsdl:binding</code> will be inspected. For example,
065: * one implementation may choose to behave as if this feature is enabled,
066: * another implementation may only choose to verify the SEI's
067: * parameter/return type bindings.
068: * </ul>
069: *
070: * @see javax.xml.ws.soap.AddressingFeature
071: *
072: * @since JAX-WS 2.1
073: */
074: public final class RespectBindingFeature extends WebServiceFeature {
075: /**
076: *
077: * Constant value identifying the RespectBindingFeature
078: */
079: public static final String ID = "javax.xml.ws.RespectBindingFeature";
080:
081: /**
082: * Creates an <code>RespectBindingFeature</code>.
083: * The instance created will be enabled.
084: */
085: public RespectBindingFeature() {
086: this .enabled = true;
087: }
088:
089: /**
090: * Creates an RespectBindingFeature
091: *
092: * @param enabled specifies whether this feature should
093: * be enabled or not.
094: */
095: public RespectBindingFeature(boolean enabled) {
096: this .enabled = enabled;
097: }
098:
099: /**
100: * {@inheritDoc}
101: */
102: public String getID() {
103: return ID;
104: }
105: }
|