Author: barrettj Date: Mon Apr 12 21:04:49 2010 New Revision: 933413 URL: http://svn.apache.org/viewvc?rev=933413&view=rev Log: Add support for RespectBinding feature set via a sparse composite (such as via a deployment descriptor). Add associated TDD test.
Added: axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataRespectBindingFeatureTests.java Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataMTOMFeatureTests.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?rev=933413&r1=933412&r2=933413&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java Mon Apr 12 21:04:49 2010 @@ -122,37 +122,9 @@ public class BindingProvider implements } } - // See if the metadata from creating the service indicates that MTOM should be enabled + // See if the metadata from creating the service indicates that MTOM and/or RespectBinding should be enabled if (binding instanceof SOAPBinding) { - // MTOM can be enabled either at the ServiceDescription level (via the WSDL binding type) or - // at the EndpointDescription level via the binding type used to create a Dispatch. - boolean enableMTOMFromMetadata = false; - int mtomThreshold = 0; - - // if we have an SEI for the port, then we'll use it in order to search for MTOM configuration - if(endpointDesc.getEndpointInterfaceDescription() != null - && - endpointDesc.getEndpointInterfaceDescription().getSEIClass() != null) { - enableMTOMFromMetadata = endpointDesc.getServiceDescription().isMTOMEnabled(serviceDelegate, - endpointDesc.getEndpointInterfaceDescription().getSEIClass()); - mtomThreshold = getMTOMThreshold(endpointDesc.getServiceDescription(), serviceDelegate, - endpointDesc.getEndpointInterfaceDescription().getSEIClass()); - } - else { - enableMTOMFromMetadata = endpointDesc.getServiceDescription().isMTOMEnabled(serviceDelegate); - // Threshold does not need to be set here based on the sparse composite (i.e. depolyment descriptor) - // since it can only be applied to a port injection (i.e. an SEI) using a DD. - } - if (!enableMTOMFromMetadata) { - String bindingType = endpointDesc.getClientBindingID(); - enableMTOMFromMetadata = (bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || - bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)); - } - - if (enableMTOMFromMetadata) { - ((SOAPBinding) binding).setMTOMEnabled(true); - ((SOAPBinding) binding).setMTOMThreshold(mtomThreshold); - } + configureBindingFromMetadata(); } // check for properties that need to be set on the BindingProvider @@ -186,6 +158,55 @@ public class BindingProvider implements } } + /** + * Configure the binding from the Metadata for MTOM and RespectBinding. + */ + private void configureBindingFromMetadata() { + // MTOM can be enabled either at the ServiceDescription level (via the WSDL binding type) or + // at the EndpointDescription level via the binding type used to create a Dispatch. + boolean enableMTOMFromMetadata = false; + int mtomThreshold = 0; + boolean enableRespectBindingdFromMetadata = false; + + // if we have an SEI for the port, then we'll use it in order to search for MTOM configuration + if(endpointDesc.getEndpointInterfaceDescription() != null + && + endpointDesc.getEndpointInterfaceDescription().getSEIClass() != null) { + enableMTOMFromMetadata = endpointDesc.getServiceDescription().isMTOMEnabled(serviceDelegate, + endpointDesc.getEndpointInterfaceDescription().getSEIClass()); + mtomThreshold = getMTOMThreshold(endpointDesc.getServiceDescription(), serviceDelegate, + endpointDesc.getEndpointInterfaceDescription().getSEIClass()); + + enableRespectBindingdFromMetadata = isRespectBindingEnabled(endpointDesc.getServiceDescription(), serviceDelegate, + endpointDesc.getEndpointInterfaceDescription().getSEIClass()); + } + else { + enableMTOMFromMetadata = endpointDesc.getServiceDescription().isMTOMEnabled(serviceDelegate); + // Threshold & RespectBinding does not need to be set here based on the sparse composite (i.e. depolyment descriptor) + // since it can only be applied to a port injection (i.e. an SEI) using a DD. + } + if (!enableMTOMFromMetadata) { + String bindingType = endpointDesc.getClientBindingID(); + enableMTOMFromMetadata = (bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || + bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)); + } + + if (enableMTOMFromMetadata) { + ((SOAPBinding) binding).setMTOMEnabled(true); + ((SOAPBinding) binding).setMTOMThreshold(mtomThreshold); + } + + if (enableRespectBindingdFromMetadata) { + ((SOAPBinding) binding).setRespectBindingEnabled(true); + } + } + + private boolean isRespectBindingEnabled(ServiceDescription serviceDescription, ServiceDelegate serviceDelegateKey, + Class seiClass) { + boolean isEnabled = serviceDescription.isRespectBindingEnabled(serviceDelegateKey, seiClass); + return isEnabled; + } + private int getMTOMThreshold(ServiceDescription serviceDescription, ServiceDelegate serviceDelegate, Class seiClass) { int threshold = serviceDescription.getMTOMThreshold(serviceDelegate, seiClass); Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java?rev=933413&r1=933412&r2=933413&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java Mon Apr 12 21:04:49 2010 @@ -44,6 +44,7 @@ import java.util.Set; public class SOAPBinding extends BindingImpl implements javax.xml.ws.soap.SOAPBinding { private boolean mtomEnabled = false; private int mtomThreshold = 0; + private boolean respectBindingEnabled = false; private static Log log = LogFactory.getLog(SOAPBinding.class); @@ -61,6 +62,12 @@ public class SOAPBinding extends Binding public void setMTOMThreshold(int threshold) { mtomThreshold = threshold; } + public boolean isRespectBindingEnabled() { + return respectBindingEnabled; + } + public void setRespectBindingEnabled(boolean enabled) { + respectBindingEnabled = enabled; + } /* * (non-Javadoc) * Modified: axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataMTOMFeatureTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataMTOMFeatureTests.java?rev=933413&r1=933412&r2=933413&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataMTOMFeatureTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataMTOMFeatureTests.java Mon Apr 12 21:04:49 2010 @@ -37,7 +37,8 @@ import java.util.Map; import junit.framework.TestCase; /** - * Validate the setting up of the MTOM WebServiceFeature via meta-data (such as a deployment descriptor) + * Validate the setting up of the MTOM WebServiceFeature on the client side via meta-data + * (such as a deployment descriptor) */ public class ClientMetadataMTOMFeatureTests extends TestCase { static final String namespaceURI = "http://description.jaxws.axis2.apache.org"; @@ -283,7 +284,8 @@ public class ClientMetadataMTOMFeatureTe } /** - * Validate if there are multiple instances of the same feature for a port in the list, the last one is used. + * Validate if there are multiple instances of the same feature for a port in the list indicating + * a threshold, the last one is used. */ public void testMultipleFeaturesForPortThreshold() { QName serviceQName = new QName(namespaceURI, svcLocalPart); @@ -318,7 +320,11 @@ public class ClientMetadataMTOMFeatureTe assertEquals("Threashold value incorrect", MTOM_THRESHOLD, enabledSoapBinding.getMTOMThreshold()); } - public void testMultipoleFeaturesForPortEnable() { + /** + * Validate if there are multiple instances of the same feature for a port in the list indicating + * enablement, the last one is used. + */ + public void testMultipleFeaturesForPortEnable() { QName serviceQName = new QName(namespaceURI, svcLocalPart); URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl); DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite(); @@ -347,7 +353,7 @@ public class ClientMetadataMTOMFeatureTe ClientMetadataMTOMPortSEI enabledPort = service.getPort(portQN1, ClientMetadataMTOMPortSEI.class); BindingProvider enabledBindingProvider = (BindingProvider) enabledPort; SOAPBinding enabledSoapBinding = (SOAPBinding) enabledBindingProvider.getBinding(); - assertFalse("MTOM is not enabled", enabledSoapBinding.isMTOMEnabled()); + assertFalse("MTOM is enabled and should not be", enabledSoapBinding.isMTOMEnabled()); } /** Added: axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataRespectBindingFeatureTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataRespectBindingFeatureTests.java?rev=933413&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataRespectBindingFeatureTests.java (added) +++ axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataRespectBindingFeatureTests.java Mon Apr 12 21:04:49 2010 @@ -0,0 +1,229 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis2.jaxws.spi; + +import org.apache.axis2.jaxws.binding.SOAPBinding; +import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite; +import org.apache.axis2.jaxws.description.builder.MDQConstants; +import org.apache.axis2.jaxws.description.builder.MTOMAnnot; +import org.apache.axis2.jaxws.description.builder.RespectBindingAnnot; + +import javax.jws.WebService; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; + +import java.lang.annotation.Annotation; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import junit.framework.TestCase; + +/** + * Validate the setting up of the RespectBinding WebServiceFeature on the client side via meta-data + * (such as a deployment descriptor) + */ +public class ClientMetadataRespectBindingFeatureTests extends TestCase { + static final String namespaceURI = "http://description.jaxws.axis2.apache.org"; + static final String svcLocalPart = "svcLocalPart"; + static final String multiPortWsdl = "ClientMetadataMultiPort.wsdl"; + static final String multiPortWsdl_portLocalPart1 = "portLocalPartMulti1"; + static final String multiPortWsdl_portLocalPart2 = "portLocalPartMulti2"; + + /** + * Validate that RespectBinding can be enabled via a sparse composite on the service. + */ + public void testRespectBindingEnabled() { + Service service = createService(); + ClientMetadataRespectBindingPortSEI port = service.getPort(ClientMetadataRespectBindingPortSEI.class); + + BindingProvider bindingProvider = (BindingProvider) port; + SOAPBinding soapBinding = (SOAPBinding) bindingProvider.getBinding(); + assertTrue("RespectBinding is not enabled", soapBinding.isRespectBindingEnabled()); + } + + /** + * Validate that RespectBinding is disabled (by default) for a port that does not specify the feature. + */ + public void testRespectBindingDefault() { + Service service = createService(); + ClientMetadataRespectBindingPortSEI2 port = service.getPort(ClientMetadataRespectBindingPortSEI2.class); + + BindingProvider bindingProvider = (BindingProvider) port; + SOAPBinding soapBinding = (SOAPBinding) bindingProvider.getBinding(); + assertFalse("RespectBinding is enabled and should not be", soapBinding.isRespectBindingEnabled()); + + } + + /** + * Validate that RespectBinding can be enabled on some ports and not others by explicitly setting the features. + */ + public void testRespectBindingEnableSomeNotOthersExplicitly() { + QName serviceQName = new QName(namespaceURI, svcLocalPart); + URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl); + DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite(); + + Map<String, List<Annotation>> map = new HashMap(); + + ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>(); + // Enable RespectBinding explicitly on one port + RespectBindingAnnot respectBindingFeature = new RespectBindingAnnot(); + respectBindingFeature.setEnabled(true); + wsFeatures.add(respectBindingFeature); + map.put(ClientMetadataRespectBindingPortSEI.class.getName(), wsFeatures); + + // Disable RespectBinding explicitly on a different port + ArrayList<Annotation> wsFeatures2 = new ArrayList<Annotation>(); + RespectBindingAnnot respectBindingFeatureDisable = new RespectBindingAnnot(); + respectBindingFeatureDisable.setEnabled(false); + wsFeatures2.add(respectBindingFeatureDisable); + map.put(ClientMetadataRespectBindingPortSEI2.class.getName(), wsFeatures2); + + serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map); + ServiceDelegate.setServiceMetadata(serviceDBC); + Service service = Service.create(wsdlUrl, serviceQName); + + // Validate that RespectBinding is enabled on one port and disabled on the other + QName portQN1 = new QName(namespaceURI, multiPortWsdl_portLocalPart1); + QName portQN2 = new QName(namespaceURI, multiPortWsdl_portLocalPart2); + + ClientMetadataRespectBindingPortSEI enabledPort = service.getPort(portQN1, ClientMetadataRespectBindingPortSEI.class); + BindingProvider enabledBindingProvider = (BindingProvider) enabledPort; + SOAPBinding enabledSoapBinding = (SOAPBinding) enabledBindingProvider.getBinding(); + assertTrue("RespectBinding is not enabled", enabledSoapBinding.isRespectBindingEnabled()); + + ClientMetadataRespectBindingPortSEI2 disabledPort = service.getPort(portQN2, ClientMetadataRespectBindingPortSEI2.class); + BindingProvider disabledBindingProvider = (BindingProvider) disabledPort; + SOAPBinding disabledSoapBinding = (SOAPBinding) disabledBindingProvider.getBinding(); + assertFalse("RespectBinding is enabled and should not be", disabledSoapBinding.isRespectBindingEnabled()); + } + + /** + * Validate that RespectBinding can be enabled on some ports and not others by not specifying the RespectBinding feature + * on the ports it should not be enabled on. + */ + public void testRespectBindingEnableSomeNotOthersUnspecified() { + QName serviceQName = new QName(namespaceURI, svcLocalPart); + URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl); + DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite(); + + Map<String, List<Annotation>> map = new HashMap(); + + ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>(); + // Enable RespectBinding explicitly on one port + RespectBindingAnnot respectBindingFeature = new RespectBindingAnnot(); + respectBindingFeature.setEnabled(true); + wsFeatures.add(respectBindingFeature); + map.put(ClientMetadataRespectBindingPortSEI.class.getName(), wsFeatures); + + // Do not specify the RespectBinding feature for the other port + + serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map); + ServiceDelegate.setServiceMetadata(serviceDBC); + Service service = Service.create(wsdlUrl, serviceQName); + + // Validate that RespectBinding is enabled on one port and disabled on the other + QName portQN1 = new QName(namespaceURI, multiPortWsdl_portLocalPart1); + QName portQN2 = new QName(namespaceURI, multiPortWsdl_portLocalPart2); + + ClientMetadataRespectBindingPortSEI enabledPort = service.getPort(portQN1, ClientMetadataRespectBindingPortSEI.class); + BindingProvider enabledBindingProvider = (BindingProvider) enabledPort; + SOAPBinding enabledSoapBinding = (SOAPBinding) enabledBindingProvider.getBinding(); + assertTrue("RespectBinding is not enabled", enabledSoapBinding.isRespectBindingEnabled()); + + ClientMetadataRespectBindingPortSEI2 disabledPort = service.getPort(portQN2, ClientMetadataRespectBindingPortSEI2.class); + BindingProvider disabledBindingProvider = (BindingProvider) disabledPort; + SOAPBinding disabledSoapBinding = (SOAPBinding) disabledBindingProvider.getBinding(); + assertFalse("RespectBinding is enabled and should not be", disabledSoapBinding.isRespectBindingEnabled()); + } + + /** + * Validate if there are multiple instances of the same feature for a port in the list indicating + * enablement, the last one is used. + */ + public void testMultipleFeaturesForPortEnable() { + QName serviceQName = new QName(namespaceURI, svcLocalPart); + URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl); + DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite(); + + Map<String, List<Annotation>> map = new HashMap(); + + ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>(); + // Enable RespectBinding explicitly then add another feature that disables it explicitly. + RespectBindingAnnot respectBindingFeature = new RespectBindingAnnot(); + respectBindingFeature.setEnabled(true); + wsFeatures.add(respectBindingFeature); + + RespectBindingAnnot mtomFeature2 = new RespectBindingAnnot(); + mtomFeature2.setEnabled(false); + wsFeatures.add(mtomFeature2); + + map.put(ClientMetadataRespectBindingPortSEI.class.getName(), wsFeatures); + + serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map); + ServiceDelegate.setServiceMetadata(serviceDBC); + Service service = Service.create(wsdlUrl, serviceQName); + + QName portQN1 = new QName(namespaceURI, multiPortWsdl_portLocalPart1); + + ClientMetadataRespectBindingPortSEI enabledPort = service.getPort(portQN1, ClientMetadataRespectBindingPortSEI.class); + BindingProvider enabledBindingProvider = (BindingProvider) enabledPort; + SOAPBinding enabledSoapBinding = (SOAPBinding) enabledBindingProvider.getBinding(); + assertFalse("RespectBinding is enabled and should not be", enabledSoapBinding.isRespectBindingEnabled()); + } + + + /** + * Create a service as would be done via injection or lookup, including a sparse composite that + * contains features (as might be set by a deployment descriptor). + * + * @return a Service created as done via injection or lookup. + */ + private Service createService() { + // Even for a port injection or lookup, the service will also be treated as an injection or lookup + // So we need to setup the sparse DBC to create the service + QName serviceQName = new QName(namespaceURI, svcLocalPart); + URL wsdlUrl = ClientMetadataTest.getWsdlURL(multiPortWsdl); + DescriptionBuilderComposite serviceDBC = new DescriptionBuilderComposite(); + + Map<String, List<Annotation>> map = new HashMap(); + ArrayList<Annotation> wsFeatures = new ArrayList<Annotation>(); + RespectBindingAnnot respectBindingFeature = new RespectBindingAnnot(); + respectBindingFeature.setEnabled(true); + wsFeatures.add(respectBindingFeature); + map.put(ClientMetadataRespectBindingPortSEI.class.getName(), wsFeatures); + serviceDBC.getProperties().put(MDQConstants.SEI_FEATURES_MAP, map); + ServiceDelegate.setServiceMetadata(serviceDBC); + Service service = Service.create(wsdlUrl, serviceQName); + return service; + } + +} + +...@webservice(name="EchoMessagePortType", targetNamespace="http://description.jaxws.axis2.apache.org") +interface ClientMetadataRespectBindingPortSEI { + public String echoMessage(String string); +} + +...@webservice(name="EchoMessagePortType", targetNamespace="http://description.jaxws.axis2.apache.org") +interface ClientMetadataRespectBindingPortSEI2 { + public String echoMessage(String string); +} Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java?rev=933413&r1=933412&r2=933413&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java Mon Apr 12 21:04:49 2010 @@ -222,9 +222,19 @@ public interface ServiceDescription { * descriptor). * * @param serviceDelegateKey The instance of the service delegate related to this service - * @param seiClass The SEI for the port to retried the MTOM threshold for - * @return the MTOM thredhold if set, or 0 if not set. + * @param seiClass The SEI for the port to retrieve the MTOM threshold for + * @return the MTOM threshold if set, or 0 if not set. */ public int getMTOMThreshold(Object serviceDelegateKey, Class seiClass); + /** + * Return whether RespectBinding is enabled as set by the Client via a sparse composite (such as a client deployment + * descriptor). + * + * @param serviceDelegateKey The instance of the service delegate related to this service + * @param seiClass The SEI for the port to retrieve the RespectBinding setting for. + * @return true if RespectBinding is enabled; false otherwise. + */ + public abstract boolean isRespectBindingEnabled(Object serviceDelegateKey, Class seiClass); + } Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?rev=933413&r1=933412&r2=933413&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Mon Apr 12 21:04:49 2010 @@ -40,6 +40,7 @@ import org.apache.axis2.jaxws.descriptio import org.apache.axis2.jaxws.description.builder.MDQConstants; import org.apache.axis2.jaxws.description.builder.MTOMAnnot; import org.apache.axis2.jaxws.description.builder.PortComposite; +import org.apache.axis2.jaxws.description.builder.RespectBindingAnnot; import static org.apache.axis2.jaxws.description.builder.MDQConstants.RETURN_TYPE_FUTURE; import static org.apache.axis2.jaxws.description.builder.MDQConstants.RETURN_TYPE_RESPONSE; @@ -2942,4 +2943,23 @@ public class ServiceDescriptionImpl } return featureList; } + + public boolean isRespectBindingEnabled(Object serviceDelegateKey, Class seiClass) { + boolean enabled = false; + List<Annotation> seiFeatureList = getSEIFeatureList(serviceDelegateKey, seiClass); + if (log.isDebugEnabled()) { + log.debug("Feature list for delegate: " + serviceDelegateKey + ", and SEI: " + seiClass + + ", is: " + seiFeatureList); + } + if (seiFeatureList != null) { + for (int i = 0; i < seiFeatureList.size(); i++) { + Annotation checkAnnotation = seiFeatureList.get(i); + if (checkAnnotation instanceof RespectBindingAnnot) { + RespectBindingAnnot respectBindingAnnot = (RespectBindingAnnot) checkAnnotation; + enabled = respectBindingAnnot.enabled(); + } + } + } + return enabled; + } }