geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1094334 - in /geronimo/server/trunk/plugins: axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/ cxf/geronimo-cxf/src/main/java/org/apache/ge...
Date Mon, 18 Apr 2011 07:59:38 GMT
Author: xuhaihong
Date: Mon Apr 18 07:59:38 2011
New Revision: 1094334

URL: http://svn.apache.org/viewvc?rev=1094334&view=rev
Log:
GERONIMO-5905 GERONIMO-5906 GERONIMO-5907 Add WebServiceFeature annotation support for WebServiceClient annotation

Added:
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java   (with props)
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java   (with props)
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java   (with props)
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java   (with props)
Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java   (contents, props changed)
    geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java   (contents, props changed)
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotationHelperTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationExample.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/webservice-ref-expected.xml
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/EndpointInfo.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/PortMethodInterceptor.java

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2ServiceRefBuilder.java Mon Apr 18 07:59:38 2011
@@ -57,20 +57,15 @@ public class Axis2ServiceRefBuilder exte
 
     private static final Logger log = LoggerFactory.getLogger(Axis2ServiceRefBuilder.class);
 
-    public Axis2ServiceRefBuilder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
-                                  @ParamAttribute(name = "eeNamespaces") String[] eeNamespaces) {
+    public Axis2ServiceRefBuilder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment, @ParamAttribute(name = "eeNamespaces") String[] eeNamespaces) {
         super(defaultEnvironment, eeNamespaces);
     }
 
     @Override
-    public Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef,
-                                Module module, Bundle bundle, Class serviceInterfaceClass,
-                                QName serviceQName, URI wsdlURI, Class serviceReferenceType,
-                                Map<Class, PortComponentRef> portComponentRefMap) throws DeploymentException {
+    protected Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef, Module module, Bundle bundle, Class serviceInterfaceClass, QName serviceQName, URI wsdlURI,
+            Class serviceReferenceType, Map<Class<?>, PortComponentRef> portComponentRefMap) throws DeploymentException {
         registerConfigGBean(module);
-        EndpointInfoBuilder builder = new EndpointInfoBuilder(serviceInterfaceClass,
-                gerServiceRef, portComponentRefMap, module, bundle,
-                wsdlURI, serviceQName);
+        EndpointInfoBuilder builder = new EndpointInfoBuilder(serviceInterfaceClass, gerServiceRef, portComponentRefMap, module, bundle, wsdlURI, serviceQName);
         builder.build();
 
         wsdlURI = builder.getWsdlURI();
@@ -90,22 +85,21 @@ public class Axis2ServiceRefBuilder exte
         }
 
         String serviceReferenceName = (serviceReferenceType == null) ? null : serviceReferenceType.getName();
-        return new Axis2ServiceReference(serviceInterfaceClass.getName(), serviceReferenceName, wsdlURI,
-                serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
+
+        return new Axis2ServiceReference(serviceInterfaceClass.getName(), serviceReferenceName, wsdlURI, serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
     }
 
     private void registerConfigGBean(Module module) throws DeploymentException {
         EARContext context = module.getEarContext();
-        AbstractName containerFactoryName = context.getNaming().createChildName(
-                module.getModuleName(), "Axis2ConfigGBean",
-                GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
+        AbstractName containerFactoryName = context.getNaming().createChildName(module.getModuleName(), "Axis2ConfigGBean", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
 
         try {
             context.getGBeanInstance(containerFactoryName);
         } catch (GBeanNotFoundException e1) {
             GBeanData configGBeanData = new GBeanData(containerFactoryName, Axis2ConfigGBean.class);
             configGBeanData.setAttribute("moduleName", module.getModuleName());
-            configGBeanData.setReferencePattern("Axis2ModuleRegistry", new AbstractNameQuery(Artifact.create("org.apache.geronimo.configs/axis2//car"), Collections.emptyMap(), Axis2ModuleRegistry.class.getName()));
+            configGBeanData.setReferencePattern("Axis2ModuleRegistry", new AbstractNameQuery(Artifact.create("org.apache.geronimo.configs/axis2//car"), Collections.emptyMap(),
+                    Axis2ModuleRegistry.class.getName()));
             try {
                 context.addGBean(configGBeanData);
             } catch (GBeanAlreadyExistsException e) {

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java Mon Apr 18 07:59:38 2011
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
 public class CXFServiceRefBuilder extends JAXWSServiceRefBuilder {
 
     private static final Logger LOG = LoggerFactory.getLogger(CXFServiceRefBuilder.class);
-        
+
     public CXFServiceRefBuilder(Environment defaultEnvironment,
                                 String[] eeNamespaces) {
         super(defaultEnvironment, eeNamespaces);
@@ -51,11 +51,11 @@ public class CXFServiceRefBuilder extend
 
     @Override
     public Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef,
-                                Module module, Bundle bundle, Class serviceInterface, 
-                                QName serviceQName, URI wsdlURI, Class serviceReference, 
-                                Map<Class, PortComponentRef> portComponentRefMap) throws DeploymentException {
+                                Module module, Bundle bundle, Class serviceInterface,
+                                QName serviceQName, URI wsdlURI, Class serviceReference,
+                                Map<Class<?>, PortComponentRef> portComponentRefMap) throws DeploymentException {
         EndpointInfoBuilder builder = new EndpointInfoBuilder(serviceInterface,
-                gerServiceRef, portComponentRefMap, module, bundle, 
+                gerServiceRef, portComponentRefMap, module, bundle,
                 wsdlURI, serviceQName);
         builder.build();
 
@@ -72,11 +72,10 @@ public class CXFServiceRefBuilder extend
         }
 
         String serviceReferenceName = (serviceReference == null) ? null : serviceReference.getName();
-        
-        return new CXFServiceReference(serviceInterface.getName(), serviceReferenceName,  wsdlURI,
-                serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
+
+        return new CXFServiceReference(serviceInterface.getName(), serviceReferenceName, wsdlURI, serviceQName, module.getModuleName(), handlerChainsXML, seiInfoMap);
     }
-        
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {

Propchange: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/plugins/cxf/geronimo-cxf-builder/src/main/java/org/apache/geronimo/cxf/builder/CXFServiceRefBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java (original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java Mon Apr 18 07:59:38 2011
@@ -25,9 +25,6 @@ import javax.naming.NamingException;
 import javax.xml.namespace.QName;
 import javax.xml.ws.handler.HandlerResolver;
 
-import org.apache.openejb.jee.HandlerChains;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
@@ -41,6 +38,9 @@ import org.apache.geronimo.jaxws.client.
 import org.apache.geronimo.jaxws.client.JAXWSServiceReference;
 import org.apache.geronimo.jaxws.client.PortMethodInterceptor;
 import org.apache.geronimo.jaxws.handler.GeronimoHandlerResolver;
+import org.apache.openejb.jee.HandlerChains;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CXFServiceReference extends JAXWSServiceReference {
 

Propchange: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java Mon Apr 18 07:59:38 2011
@@ -17,6 +17,7 @@
 
 package org.apache.geronimo.j2ee.deployment.annotation;
 
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -25,11 +26,18 @@ import java.util.Collection;
 import java.util.List;
 
 import javax.jws.HandlerChain;
+import javax.xml.ws.RespectBinding;
 import javax.xml.ws.WebServiceClient;
 import javax.xml.ws.WebServiceRef;
 import javax.xml.ws.WebServiceRefs;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.openejb.jee.Addressing;
+import org.apache.openejb.jee.AddressingResponses;
 import org.apache.openejb.jee.JndiConsumer;
+import org.apache.openejb.jee.PortComponentRef;
 import org.apache.openejb.jee.ServiceRef;
 import org.apache.xbean.finder.AbstractFinder;
 import org.slf4j.Logger;
@@ -348,6 +356,83 @@ public final class WebServiceRefAnnotati
             serviceRef.getInjectionTarget().add(configureInjectionTarget(method, field));
         }
 
+        // web service features
+        Annotation[] candidateAnnotations = null;
+        if (cls != null) {
+            candidateAnnotations = cls.getAnnotations();
+        } else if (method != null) {
+            candidateAnnotations = method.getAnnotations();
+        } else if (field != null) {
+            candidateAnnotations = field.getAnnotations();
+        }
+        if (candidateAnnotations != null && candidateAnnotations.length > 0) {
+            List<Annotation> webServiceFeatureAnnotations = new ArrayList<Annotation>();
+            for (Annotation anno : candidateAnnotations) {
+                if (anno.annotationType().isAnnotationPresent(WebServiceFeatureAnnotation.class)) {
+                    webServiceFeatureAnnotations.add(anno);
+                }
+            }
+            if (webServiceFeatureAnnotations.size() > 0) {
+                if (javax.xml.ws.Service.class.isAssignableFrom(webServiceRefType)) {
+                    log.warn("In current JAX-WS spec, no standard web service feature is supported on service creation, " + webServiceFeatureAnnotations + " are ignored");
+                } else {
+                    PortComponentRef portComponentRef = getPortComponentRef(serviceRef, webServiceRefType.getName());
+
+                    for (Annotation webServiceFeatureAnnotation : webServiceFeatureAnnotations) {
+                        Class<? extends Annotation> webServiceFeatureAnnotationType = webServiceFeatureAnnotation.annotationType();
+                        if (webServiceFeatureAnnotationType == MTOM.class) {
+                            MTOM mtom = (MTOM) webServiceFeatureAnnotation;
+                            if (portComponentRef.getMtomThreshold() == null) {
+                                portComponentRef.setMtomThreshold(mtom.threshold());
+                            }
+                            if (portComponentRef.getEnableMtom() == null) {
+                                portComponentRef.setEnableMtom(mtom.enabled());
+                            }
+                        } else if (webServiceFeatureAnnotationType == javax.xml.ws.soap.Addressing.class) {
+                            javax.xml.ws.soap.Addressing addressingAnnotation = (javax.xml.ws.soap.Addressing) webServiceFeatureAnnotation;
+                            Addressing addressing = portComponentRef.getAddressing();
+                            if (addressing == null) {
+                                addressing = new Addressing();
+                                addressing.setEnabled(addressingAnnotation.enabled());
+                                addressing.setRequired(addressingAnnotation.required());
+                                addressing.setResponses(AddressingResponses.valueOf(addressingAnnotation.responses().toString()));
+                                portComponentRef.setAddressing(addressing);
+                            } else {
+                                if (addressing.getEnabled() == null) {
+                                    addressing.setEnabled(addressingAnnotation.enabled());
+                                }
+                                if (addressing.getRequired() == null) {
+                                    addressing.setRequired(addressingAnnotation.required());
+                                }
+                                if (addressing.getResponses() == null) {
+                                    addressing.setResponses(AddressingResponses.valueOf(addressingAnnotation.responses().toString()));
+                                }
+                            }
+                        } else if (webServiceFeatureAnnotationType == RespectBinding.class) {
+                            RespectBinding respectBinding = (RespectBinding) webServiceFeatureAnnotation;
+                            if (portComponentRef.getRespectBinding() == null) {
+                                portComponentRef.setRespectBinding(respectBinding.enabled());
+                            }
+                        } else {
+                            log.warn("Unsupport web service feature annotation " + webServiceFeatureAnnotation + " on " + webServiceRefName);
+                        }
+                    }
+
+                }
+            }
+        }
     }
 
+    private static PortComponentRef getPortComponentRef(ServiceRef serviceRef, String seiInterfaceName) {
+        List<PortComponentRef> portComponentRefs = serviceRef.getPortComponentRef();
+        for (PortComponentRef portComponentRef : portComponentRefs) {
+            if (portComponentRef.getServiceEndpointInterface().equals(seiInterfaceName)) {
+                return portComponentRef;
+            }
+        }
+        PortComponentRef portComponentRef = new PortComponentRef();
+        portComponentRef.setServiceEndpointInterface(seiInterfaceName);
+        portComponentRefs.add(portComponentRef);
+        return portComponentRef;
+    }
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotationHelperTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotationHelperTest.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotationHelperTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotationHelperTest.java Mon Apr 18 07:59:38 2011
@@ -37,8 +37,11 @@ import javax.persistence.PersistenceCont
 import javax.persistence.PersistenceUnit;
 import javax.persistence.PersistenceUnits;
 import javax.xml.bind.JAXBException;
+import javax.xml.ws.Service;
 import javax.xml.ws.WebServiceRef;
 import javax.xml.ws.WebServiceRefs;
+
+import org.apache.geronimo.j2ee.deployment.annotation.WebServiceRefAnnotationExample.MyService;
 import org.apache.geronimo.testsupport.XmlBeansTestSupport;
 import org.apache.openejb.jee.JaxbJavaee;
 import org.apache.openejb.jee.WebApp;
@@ -63,14 +66,14 @@ public class AnnotationHelperTest extend
     static class TestClassFinder extends ClassFinder {
         public TestClassFinder(Class [] classes) {
             super(classes);
-        }        
+        }
         public List<Field> findAnnotatedFields(Class<? extends Annotation> arg) {
             List<Field> fields = super.findAnnotatedFields(arg);
             Collections.sort(fields, new FieldComparator());
             return fields;
         }
     }
-    
+
     static class FieldComparator implements Comparator {
         public int compare(Object o1, Object o2) {
             return compare((Field)o1, (Field)o2);
@@ -79,7 +82,7 @@ public class AnnotationHelperTest extend
             String field1 = o1.getDeclaringClass().getName() + "/" + o1.getName();
             String field2 = o2.getDeclaringClass().getName() + "/" + o2.getName();
             return field1.compareTo(field2);
-        }        
+        }
     }
 
     public void testEJBAnnotationHelper() throws Exception {
@@ -107,7 +110,7 @@ public class AnnotationHelperTest extend
         assertTrue(annotatedFields.contains(EJBAnnotationExample.class.getDeclaredField("annotatedField4")));
         assertTrue(annotatedFields.contains(EJBAnnotationExample.class.getDeclaredField("annotatedField5")));
         assertTrue(annotatedFields.contains(EJBAnnotationExample.class.getDeclaredField("annotatedField6")));
-        
+
         //-------------------------------------------------
         // Ensure annotations are processed correctly
         //-------------------------------------------------
@@ -262,8 +265,8 @@ public class AnnotationHelperTest extend
         List<Method> annotatedMethods = classFinder.findAnnotatedMethods(WebServiceRef.class);
         assertNotNull(annotatedMethods);
         assertEquals(5, annotatedMethods.size());
-        assertTrue(annotatedMethods.contains(WebServiceRefAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod1", new Class[]{boolean.class})));
-        assertTrue(annotatedMethods.contains(WebServiceRefAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod2", new Class[]{String.class})));
+        assertTrue(annotatedMethods.contains(WebServiceRefAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod1", new Class[]{MyService.class})));
+        assertTrue(annotatedMethods.contains(WebServiceRefAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod2", new Class[]{Service.class})));
         assertTrue(annotatedMethods.contains(HandlerChainAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod1", new Class[]{String.class})));
         assertTrue(annotatedMethods.contains(HandlerChainAnnotationExample.class.getDeclaredMethod("setAnnotatedMethod2", new Class[]{int.class})));
 
@@ -287,8 +290,6 @@ public class AnnotationHelperTest extend
         WebServiceRefAnnotationHelper.processAnnotations(webApp, classFinder);
         URL expectedXML = classLoader.getResource("annotation/webservice-ref-expected.xml");
         XmlObject expected = XmlObject.Factory.parse(expectedXML);
-//        log.debug("[@WebServiceRef Source XML] " + '\n' + webApp.toString() + '\n');
-//        log.debug("[@WebServiceRef Expected XML]" + '\n' + expected.toString() + '\n');
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(webApp, expected, problems);
         assertTrue("Differences: " + problems, ok);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationExample.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationExample.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationExample.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationExample.java Mon Apr 18 07:59:38 2011
@@ -40,10 +40,10 @@ public class WebServiceRefAnnotationExam
                    type = Service.class,
                    value = Service.class,
                    mappedName = "mappedName12")
-    String annotatedField1;
+    Service annotatedField1;
 
     @WebServiceRef
-    int annotatedField2;
+    Service annotatedField2;
 
     //------------------------------------------------------------------------------------------
     // Method name (for setter-based injection) must follow JavaBeans conventions:
@@ -55,14 +55,14 @@ public class WebServiceRefAnnotationExam
                    value = MyService.class,
                    wsdlLocation = "WEB-INF/wsdl/WebServiceRef14.wsdl",
                    mappedName = "mappedName14")
-    public void setAnnotatedMethod1(boolean bool) {
+    public void setAnnotatedMethod1(MyService bool) {
     }
 
     @WebServiceRef(name = "WebServiceRef15",
                    value = Service.class,
                    wsdlLocation = "WEB-INF/wsdl/WebServiceRef15.wsdl",
                    mappedName = "mappedName15")
-    public void setAnnotatedMethod2(String string) {
+    public void setAnnotatedMethod2(Service string) {
     }
 
     public static class MyService extends Service {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/webservice-ref-expected.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/webservice-ref-expected.xml?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/webservice-ref-expected.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/resources/annotation/webservice-ref-expected.xml Mon Apr 18 07:59:38 2011
@@ -38,8 +38,8 @@
     </service-ref>
     <service-ref>
         <service-ref-name>WebServiceRef14</service-ref-name>
-        <service-interface>boolean</service-interface>
-        <service-ref-type>boolean</service-ref-type>
+        <service-interface>org.apache.geronimo.j2ee.deployment.annotation.WebServiceRefAnnotationExample$MyService</service-interface>
+        <service-ref-type>org.apache.geronimo.j2ee.deployment.annotation.WebServiceRefAnnotationExample$MyService</service-ref-type>
         <wsdl-file>WEB-INF/wsdl/WebServiceRef14.wsdl</wsdl-file>
         <mapped-name>mappedName14</mapped-name>
         <injection-target>

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/EndpointInfoBuilder.java Mon Apr 18 07:59:38 2011
@@ -22,6 +22,7 @@ import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -40,15 +41,22 @@ import javax.wsdl.xml.WSDLLocator;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
 import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.soap.AddressingFeature;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.jaxws.JAXWSUtils;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
+import org.apache.geronimo.jaxws.feature.AddressingFeatureInfo;
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
+import org.apache.geronimo.jaxws.feature.RespectBindingFeatureInfo;
+import org.apache.geronimo.jaxws.feature.WebServiceFeatureInfo;
 import org.apache.geronimo.jaxws.wsdl.CatalogJarWSDLLocator;
 import org.apache.geronimo.jaxws.wsdl.CatalogWSDLLocator;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPortPropertyType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPortType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
+import org.apache.openejb.jee.Addressing;
 import org.apache.openejb.jee.PortComponentRef;
 import org.apache.xml.resolver.Catalog;
 import org.apache.xml.resolver.CatalogManager;
@@ -75,11 +83,11 @@ public class EndpointInfoBuilder {
 
     private Map<Object, EndpointInfo> portInfoMap = new HashMap<Object, EndpointInfo>();
 
-    private Map<Class, PortComponentRef> portComponentRefMap;
+    private Map<Class<?>, PortComponentRef> portComponentRefMap;
 
     public EndpointInfoBuilder(Class serviceClass,
                                GerServiceRefType serviceRefType,
-                               Map<Class, PortComponentRef> portComponentRefMap,
+                               Map<Class<?>, PortComponentRef> portComponentRefMap,
                                Module module,
                                Bundle bundle,
                                URI wsdlURI,
@@ -116,10 +124,10 @@ public class EndpointInfoBuilder {
                 }
             }
         }
-        
+
         if (this.wsdlURI == null) {
             // wsdl was not explicitly specified
-            if (javax.xml.ws.Service.class.equals(this.serviceClass)) {
+            if (javax.xml.ws.Service.class == this.serviceClass) {
                 // Generic Service class specified.
                 // Service API requires a service qname so create a dummy one
                 this.serviceQName = new QName("http://noservice", "noservice");
@@ -129,9 +137,9 @@ public class EndpointInfoBuilder {
                         String portName = gerPort.getPortName().trim();
                         URL location = getLocation(gerPort);
                         String credentialsName = getCredentialsName(gerPort);
-                        boolean mtomEnabled = isMTOMEnabled(portName);
+                        List<WebServiceFeatureInfo> webServiceFeatureInfos = getWebServiceFeatureInfos(portName);
                         Map<String, Object> props = getProperties(gerPort);
-                        EndpointInfo info = new EndpointInfo(location, credentialsName, mtomEnabled, props);
+                        EndpointInfo info = new EndpointInfo(location, credentialsName, props, webServiceFeatureInfos);
                         this.portInfoMap.put(portName, info);
                     }
                 }
@@ -184,7 +192,7 @@ public class EndpointInfoBuilder {
 
         verifyPortComponentList(definition);
 
-        Map services = definition.getServices();
+        Map<QName, Service> services = definition.getServices();
         if (services.size() == 0) {
             // partial wsdl, return as is
 
@@ -207,7 +215,7 @@ public class EndpointInfoBuilder {
                                     + this.serviceQName);
                 }
             } else if (services.size() == 1) {
-                service = (Service) services.values().iterator().next();
+                service = services.values().iterator().next();
                 this.serviceQName = service.getQName();
             } else {
                 throw new DeploymentException(
@@ -226,11 +234,10 @@ public class EndpointInfoBuilder {
                 }
             }
 
-            Map wsdlPortMap = service.getPorts();
-            for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();) {
-                Map.Entry entry = (Map.Entry) iterator.next();
-                String portName = (String) entry.getKey();
-                Port port = (Port) entry.getValue();
+            Map<String, Port> wsdlPortMap = service.getPorts();
+            for (Map.Entry<String, Port> entry : wsdlPortMap.entrySet()) {
+                String portName = entry.getKey();
+                Port port = entry.getValue();
 
                 GerPortType gerPort = portMap.get(portName);
 
@@ -251,11 +258,10 @@ public class EndpointInfoBuilder {
                     throw new DeploymentException("No portType for binding: " + binding.getQName());
                 }
 
-                boolean mtomEnabled = isMTOMEnabled(portType.getQName());
-
                 Map<String, Object> props = getProperties(gerPort);
 
-                EndpointInfo info = new EndpointInfo(location, credentialsName, mtomEnabled, props);
+                List<WebServiceFeatureInfo> webServiceFeatureInfo = getWebServiceFeatureInfos(portType.getQName());
+                EndpointInfo info = new EndpointInfo(location, credentialsName, props, webServiceFeatureInfo);
                 this.portInfoMap.put(portName, info);
                 // prefer first binding listed in wsdl
                 if (!this.portInfoMap.containsKey(portType.getQName())) {
@@ -346,6 +352,38 @@ public class EndpointInfoBuilder {
         return null;
     }
 
+    private List<WebServiceFeatureInfo> getWebServiceFeatureInfos(QName portName) {
+        PortComponentRef portComponentRef = getPortComponentRef(portName);
+        if (portComponentRef == null) {
+            return new ArrayList<WebServiceFeatureInfo>(0);
+        }
+        return buildWebServiceFeatureInfos(portComponentRef);
+    }
+
+    private List<WebServiceFeatureInfo> getWebServiceFeatureInfos(String portName) {
+        PortComponentRef portComponentRef = getPortComponentRef(portName);
+        if (portComponentRef == null) {
+            return new ArrayList<WebServiceFeatureInfo>(0);
+        }
+        return buildWebServiceFeatureInfos(portComponentRef);
+    }
+
+    private List<WebServiceFeatureInfo> buildWebServiceFeatureInfos(PortComponentRef portComponentRef) {
+        List<WebServiceFeatureInfo> webServiceFeatureInfos = new ArrayList<WebServiceFeatureInfo>(3);
+        Addressing addressing = portComponentRef.getAddressing();
+        if (addressing != null) {
+            webServiceFeatureInfos.add(new AddressingFeatureInfo(addressing.getEnabled() == null ? true : addressing.getEnabled(), addressing.getRequired() == null ? false : addressing.getRequired(),
+                    addressing.getResponses() != null ? AddressingFeature.Responses.valueOf(addressing.getResponses().toString()) : AddressingFeature.Responses.ALL));
+        }
+        if (portComponentRef.getEnableMtom() != null) {
+            webServiceFeatureInfos.add(new MTOMFeatureInfo(portComponentRef.isEnableMtom(), portComponentRef.getMtomThreshold() == null ? 0 : portComponentRef.getMtomThreshold()));
+        }
+        if (portComponentRef.getRespectBinding() != null) {
+            webServiceFeatureInfos.add(new RespectBindingFeatureInfo(portComponentRef.getRespectBinding()));
+        }
+        return webServiceFeatureInfos;
+    }
+
     private void verifyPortComponentList(Definition wsdl) throws DeploymentException {
         if (this.portComponentRefMap == null) {
             return;
@@ -361,15 +399,6 @@ public class EndpointInfoBuilder {
         }
     }
 
-    private boolean isMTOMEnabled(QName portType) {
-        boolean mtomEnabled = false;
-        PortComponentRef portRef = getPortComponentRef(portType);
-        if (portRef != null) {
-            mtomEnabled = portRef.isEnableMtom();
-        }
-        return mtomEnabled;
-    }
-
     private PortComponentRef getPortComponentRef(QName portType) {
         if (this.portComponentRefMap == null) {
             return null;
@@ -386,15 +415,6 @@ public class EndpointInfoBuilder {
         return null;
     }
 
-    private boolean isMTOMEnabled(String portName) {
-        boolean mtomEnabled = false;
-        PortComponentRef portRef = getPortComponentRef(portName);
-        if (portRef != null) {
-            mtomEnabled = portRef.isEnableMtom();
-        }
-        return mtomEnabled;
-    }
-
     private PortComponentRef getPortComponentRef(String portName) {
         if (this.portComponentRefMap == null) {
             return null;

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java Mon Apr 18 07:59:38 2011
@@ -87,7 +87,7 @@ public abstract class JAXWSServiceRefBui
         }
     }
 
-    private Class loadClass(String className, Bundle bundle, String classDescription) throws DeploymentException {
+    private Class<?> loadClass(String className, Bundle bundle, String classDescription) throws DeploymentException {
         try {
             return bundle.loadClass(className);
         } catch (ClassNotFoundException e) {
@@ -102,7 +102,7 @@ public abstract class JAXWSServiceRefBui
         String name = serviceRef.getKey();
 
         String serviceInterfaceName = getStringValue(serviceRef.getServiceInterface());
-        Class serviceInterfaceClass = loadClass(serviceInterfaceName, bundle, "service");
+        Class<?> serviceInterfaceClass = loadClass(serviceInterfaceName, bundle, "service");
         if (!Service.class.isAssignableFrom(serviceInterfaceClass)) {
             throw new DeploymentException(serviceInterfaceName + " service class does not extend " + Service.class.getName());
         }
@@ -119,7 +119,7 @@ public abstract class JAXWSServiceRefBui
             }
         }
 
-        Class serviceReferenceType = null;
+        Class<?> serviceReferenceType = null;
         if (serviceRef.getServiceRefType() != null) {
             String referenceClassName = serviceRef.getServiceRefType();
             serviceReferenceType = loadClass(referenceClassName, bundle, "service reference");
@@ -130,7 +130,7 @@ public abstract class JAXWSServiceRefBui
             for (HandlerChain handlerChain : handlerChains.getHandlerChain()) {
                 for (org.apache.openejb.jee.Handler handler : handlerChain.getHandler()) {
                     String handlerClassName = getStringValue(handler.getHandlerClass());
-                    Class handlerClass = loadClass(handlerClassName, bundle, "handler");
+                    Class<?> handlerClass = loadClass(handlerClassName, bundle, "handler");
                     if (!Handler.class.isAssignableFrom(handlerClass)) {
                         throw new DeploymentException(handlerClassName + " handler class does not extend " + Handler.class.getName());
                     }
@@ -138,10 +138,10 @@ public abstract class JAXWSServiceRefBui
             }
         }
 
-        Map<Class, PortComponentRef> portComponentRefMap = new HashMap<Class, PortComponentRef>();
+        Map<Class<?>, PortComponentRef> portComponentRefMap = new HashMap<Class<?>, PortComponentRef>();
         for (PortComponentRef portComponentRef : serviceRef.getPortComponentRef()) {
             String serviceEndpointInterfaceType = getStringValue(portComponentRef.getServiceEndpointInterface());
-            Class serviceEndpointClass = loadClass(serviceEndpointInterfaceType, bundle, "service endpoint");
+            Class<?> serviceEndpointClass = loadClass(serviceEndpointInterfaceType, bundle, "service endpoint");
 
             // TODO: check if it is annotated?
 
@@ -154,10 +154,10 @@ public abstract class JAXWSServiceRefBui
         put(name, ref, module.getJndiContext(), serviceRef.getInjectionTarget(), sharedContext);
     }
 
-    public abstract Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef,
+    protected abstract Object createService(ServiceRef serviceRef, GerServiceRefType gerServiceRef,
                                          Module module, Bundle bundle, Class serviceInterfaceClass,
                                          QName serviceQName, URI wsdlURI, Class serviceReferenceType,
-                                         Map<Class, PortComponentRef> portComponentRefMap) throws DeploymentException;
+                                         Map<Class<?>, PortComponentRef> portComponentRefMap) throws DeploymentException;
 
     private static Map<String, GerServiceRefType> mapServiceRefs(XmlObject[] refs) {
         Map<String, GerServiceRefType> refMap = new HashMap<String, GerServiceRefType>();

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/EndpointInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/EndpointInfo.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/EndpointInfo.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/EndpointInfo.java Mon Apr 18 07:59:38 2011
@@ -14,43 +14,61 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
+
 package org.apache.geronimo.jaxws.client;
 
 import java.io.Serializable;
 import java.net.URL;
+import java.util.List;
 import java.util.Map;
 
+import org.apache.geronimo.jaxws.feature.MTOMFeatureInfo;
+import org.apache.geronimo.jaxws.feature.WebServiceFeatureInfo;
+
 public class EndpointInfo implements Serializable {
 
     private URL location;
+
     private String credentialsName;
-    private boolean mtomEnabled;
+
     private Map<String, Object> properties;
-    
-    public EndpointInfo(URL location, String credentialsName, boolean mtomEnabled, Map<String, Object> properties) {
+
+    private List<WebServiceFeatureInfo> webServiceFeatureInfos;
+
+    public EndpointInfo(URL location, String credentialsName, Map<String, Object> properties, List<WebServiceFeatureInfo> webServiceFeatureInfos) {
         this.location = location;
-        this.credentialsName = credentialsName;  
-        this.mtomEnabled = mtomEnabled;        
+        this.credentialsName = credentialsName;
         this.properties = properties;
+        this.webServiceFeatureInfos = webServiceFeatureInfos;
     }
 
     public boolean isMTOMEnabled() {
-        return this.mtomEnabled;
+        for (WebServiceFeatureInfo webServiceFeatureInfo : webServiceFeatureInfos) {
+            if (webServiceFeatureInfo instanceof MTOMFeatureInfo) {
+                return ((MTOMFeatureInfo) webServiceFeatureInfo).isEnabled();
+            }
+        }
+        return false;
     }
-    
+
     public URL getLocation() {
         return this.location;
     }
-    
+
     public String getCredentialsName() {
         return this.credentialsName;
     }
-    
+
     public Map<String, Object> getProperties() {
         return properties;
     }
-    
+
+    public List<WebServiceFeatureInfo> getWebServiceFeatureInfos() {
+        return webServiceFeatureInfos;
+    }
+
+    @Override
     public String toString() {
-        return this.location + " " + this.credentialsName + " " + this.mtomEnabled + " " + this.properties;
+        return "EndpointInfo [location=" + location + ", properties=" + properties + ", webServiceFeatureInfos=" + webServiceFeatureInfos + "]";
     }
 }

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java Mon Apr 18 07:59:38 2011
@@ -21,11 +21,13 @@ import java.lang.reflect.InvocationTarge
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
+import java.util.List;
 import java.util.Map;
 
 import javax.naming.NamingException;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
 import javax.xml.ws.handler.HandlerResolver;
 
 import net.sf.cglib.proxy.Callback;
@@ -37,6 +39,7 @@ import net.sf.cglib.reflect.FastConstruc
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.jaxws.JAXWSUtils;
+import org.apache.geronimo.jaxws.feature.WebServiceFeatureInfo;
 import org.apache.geronimo.naming.reference.BundleAwareReference;
 import org.apache.geronimo.naming.reference.SimpleReference;
 import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
@@ -49,8 +52,7 @@ public abstract class JAXWSServiceRefere
 
     private final static Logger LOG = LoggerFactory.getLogger(JAXWSServiceReference.class);
 
-    private static final Class[] URL_SERVICE_NAME_CONSTRUCTOR =
-        new Class[] { URL.class, QName.class };
+    private static final Class<?>[] URL_SERVICE_NAME_CONSTRUCTOR = new Class[] { URL.class, QName.class };
 
     protected String serviceClassName;
     protected Bundle bundle;
@@ -123,7 +125,7 @@ public abstract class JAXWSServiceRefere
         return catalogURL;
     }
 
-    private Class getReferenceClass() throws NamingException {
+    private Class<?> getReferenceClass() throws NamingException {
         return (this.referenceClassName != null) ? loadClass(this.referenceClassName) : null;
     }
 
@@ -131,14 +133,14 @@ public abstract class JAXWSServiceRefere
         Service instance = null;
         URL wsdlURL = getWsdlURL();
 
-        Class serviceClass = loadClass(this.serviceClassName);
-        Class referenceClass = getReferenceClass();
+        Class<?> serviceClass = loadClass(this.serviceClassName);
+        Class<?> referenceClass = getReferenceClass();
 
         if (referenceClass != null && Service.class.isAssignableFrom(referenceClass)) {
             serviceClass = referenceClass;
         }
 
-        if (Service.class.equals(serviceClass)) {
+        if (Service.class == serviceClass) {
             serviceClass = GenericService.class;
         }
 
@@ -151,7 +153,19 @@ public abstract class JAXWSServiceRefere
 
         if (referenceClass != null && !Service.class.isAssignableFrom(referenceClass)) {
             // do port lookup
-            return instance.getPort(referenceClass);
+            QName portName = JAXWSUtils.getPortType(referenceClass);
+            EndpointInfo endpointInfo = seiInfoMap.get(portName);
+            if (endpointInfo != null && endpointInfo.getWebServiceFeatureInfos().size() > 0) {
+                List<WebServiceFeatureInfo> webServiceFeatureInfos = endpointInfo.getWebServiceFeatureInfos();
+                WebServiceFeature[] webServiceFeatures = new WebServiceFeature[webServiceFeatureInfos.size()];
+                int index = 0;
+                for (WebServiceFeatureInfo webServiceFeatureInfo : webServiceFeatureInfos) {
+                    webServiceFeatures[index++] = webServiceFeatureInfo.getWebServiceFeature();
+                }
+                return instance.getPort(referenceClass, webServiceFeatures);
+            } else {
+                return instance.getPort(referenceClass);
+            }
         } else {
             // return service
             return instance;
@@ -185,12 +199,14 @@ public abstract class JAXWSServiceRefere
                 FastClass.create(this.enhancedServiceClass).getConstructor(URL_SERVICE_NAME_CONSTRUCTOR);
         }
 
-        LOG.debug("Initializing service with: " + wsdlLocation + " " + serviceName);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Initializing service with: " + wsdlLocation + " " + serviceName);
+        }
 
         // associate the method interceptors with the generated service class on the current thread
         Enhancer.registerCallbacks(this.enhancedServiceClass, this.methodInterceptors);
 
-        Object[] arguments = new Object[] {wsdlLocation, serviceName};
+        Object[] arguments = new Object[] { wsdlLocation, serviceName };
 
         try {
             return (Service)this.serviceConstructor.newInstance(arguments);

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/PortMethodInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/PortMethodInterceptor.java?rev=1094334&r1=1094333&r2=1094334&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/PortMethodInterceptor.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/PortMethodInterceptor.java Mon Apr 18 07:59:38 2011
@@ -32,14 +32,13 @@ import javax.xml.ws.soap.SOAPBinding;
 
 import java.lang.reflect.Method;
 import java.net.URL;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
 public class PortMethodInterceptor implements MethodInterceptor {
 
     private static final Logger LOG = LoggerFactory.getLogger(PortMethodInterceptor.class);
-    
+
     private Map<Object, EndpointInfo> seiInfoMap;
 
     public PortMethodInterceptor(Map<Object, EndpointInfo> seiInfoMap) {
@@ -47,9 +46,9 @@ public class PortMethodInterceptor imple
     }
 
     public Object intercept(Object target, Method method, Object[] arguments, MethodProxy methodProxy) throws Throwable {
-        Object proxy = methodProxy.invokeSuper(target, arguments);       
-        
-        if (method.getName().equals("getPort")) {  
+        Object proxy = methodProxy.invokeSuper(target, arguments);
+
+        if (method.getName().equals("getPort")) {
             // it's a generic getPort() method
             Class<?> paramType = method.getParameterTypes()[0];
             if (paramType.equals(Class.class)) {
@@ -77,18 +76,18 @@ public class PortMethodInterceptor imple
                 setProperties((BindingProvider)proxy, ((QName)arguments[0]).getLocalPart());
             }
         }
-                
+
         return proxy;
     }
-    
+
     private void setProperties(BindingProvider proxy, QName portType) {
         if (portType == null) {
             return;
         }
         EndpointInfo info = this.seiInfoMap.get(portType);
-        setProperties(proxy, info);        
+        setProperties(proxy, info);
     }
-    
+
     private void setProperties(BindingProvider proxy, String portName) {
         if (portName == null) {
             return;
@@ -96,44 +95,47 @@ public class PortMethodInterceptor imple
         EndpointInfo info = this.seiInfoMap.get(portName);
         setProperties(proxy, info);
     }
-    
+
     protected void setProperties(BindingProvider proxy, EndpointInfo info) {
         if (info == null) {
             return;
-        } 
+        }
         setProperties(proxy, info, info.getProperties());
     }
-    
+
     protected void setProperties(BindingProvider proxy, EndpointInfo info, Map<String, Object> properties) {
         if (info == null) {
             return;
-        }       
-        
+        }
+
         // set mtom
         boolean enableMTOM = info.isMTOMEnabled();
         if (enableMTOM && proxy.getBinding() instanceof SOAPBinding) {
             ((SOAPBinding)proxy.getBinding()).setMTOMEnabled(enableMTOM);
-            LOG.debug("Set mtom property: " + enableMTOM);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Set mtom property: " + enableMTOM);
+            }
         }
-      
+
         // set address
         URL location = info.getLocation();
         if (location != null) {
             proxy.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location.toString());
-            LOG.debug("Set address property: " + location);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Set address property: " + location);
+            }
         }
-        
+
         // set credentials
         String credentialsName = info.getCredentialsName();
         if (credentialsName != null) {
-            NamedUsernamePasswordCredential namedUsernamePasswordCredential = findCredential(credentialsName);            
-            proxy.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, 
+            NamedUsernamePasswordCredential namedUsernamePasswordCredential = findCredential(credentialsName);
+            proxy.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
                                           namedUsernamePasswordCredential.getUsername());
-            proxy.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, 
+            proxy.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
                                          new String(namedUsernamePasswordCredential.getPassword()));
-            LOG.debug("Set username/password property: " + credentialsName);
         }
-        
+
         // set user-specified properties
         if (properties != null) {
             for (Map.Entry<String, Object> entry : properties.entrySet()) {
@@ -141,15 +143,14 @@ public class PortMethodInterceptor imple
             }
         }
     }
-    
+
     protected NamedUsernamePasswordCredential findCredential(String credentialsName) {
         Subject subject = ContextManager.getNextCaller();
         if (subject == null) {
             throw new IllegalStateException("Subject missing but authentication turned on");
         } else {
-            Set creds = subject.getPrivateCredentials(NamedUsernamePasswordCredential.class);
-            for (Iterator iterator = creds.iterator(); iterator.hasNext();) {
-                NamedUsernamePasswordCredential namedUsernamePasswordCredential = (NamedUsernamePasswordCredential) iterator.next();
+            Set<NamedUsernamePasswordCredential> creds = subject.getPrivateCredentials(NamedUsernamePasswordCredential.class);
+            for (NamedUsernamePasswordCredential namedUsernamePasswordCredential : creds) {
                 if (credentialsName.equals(namedUsernamePasswordCredential.getName())) {
                     return namedUsernamePasswordCredential;
                 }

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java?rev=1094334&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java Mon Apr 18 07:59:38 2011
@@ -0,0 +1,49 @@
+/**
+ *  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.geronimo.jaxws.feature;
+
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AddressingFeatureInfo implements WebServiceFeatureInfo {
+
+    private boolean enabled;
+
+    private boolean required;
+
+    private AddressingFeature.Responses responses;
+
+    public AddressingFeatureInfo(Addressing addressing) {
+        this(addressing.enabled(), addressing.required(), addressing.responses());
+    }
+
+    public AddressingFeatureInfo(boolean enabled, boolean required, AddressingFeature.Responses responses) {
+        this.enabled = enabled;
+        this.required = required;
+        this.responses = responses;
+    }
+
+    @Override
+    public WebServiceFeature getWebServiceFeature() {
+        return new AddressingFeature(enabled, required, responses);
+    }
+}

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/AddressingFeatureInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java?rev=1094334&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java Mon Apr 18 07:59:38 2011
@@ -0,0 +1,55 @@
+/**
+ *  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.geronimo.jaxws.feature;
+
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.MTOMFeature;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MTOMFeatureInfo implements WebServiceFeatureInfo {
+
+    private boolean enabled;
+
+    private int threshold;
+
+    public MTOMFeatureInfo(MTOM mtom) {
+        this(mtom.enabled(), mtom.threshold());
+    }
+
+    public MTOMFeatureInfo(boolean enabled, int threshold) {
+        this.enabled = enabled;
+        this.threshold = threshold;
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public int getThreshold() {
+        return threshold;
+    }
+
+    @Override
+    public WebServiceFeature getWebServiceFeature() {
+        return new MTOMFeature(enabled, threshold);
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/MTOMFeatureInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java?rev=1094334&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java Mon Apr 18 07:59:38 2011
@@ -0,0 +1,44 @@
+/**
+ *  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.geronimo.jaxws.feature;
+
+import javax.xml.ws.RespectBinding;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class RespectBindingFeatureInfo implements WebServiceFeatureInfo {
+
+    private boolean enabled;
+
+    public RespectBindingFeatureInfo(RespectBinding respectBinding) {
+        this(respectBinding.enabled());
+    }
+
+    public RespectBindingFeatureInfo(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    @Override
+    public WebServiceFeature getWebServiceFeature() {
+        return new RespectBindingFeature(enabled);
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/RespectBindingFeatureInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java?rev=1094334&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java (added)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java Mon Apr 18 07:59:38 2011
@@ -0,0 +1,30 @@
+/**
+ *  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.geronimo.jaxws.feature;
+
+import java.io.Serializable;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface WebServiceFeatureInfo extends Serializable {
+
+    public WebServiceFeature getWebServiceFeature();
+}

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/feature/WebServiceFeatureInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message