cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r538764 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/j...
Date Wed, 16 May 2007 22:23:05 GMT
Author: dkulp
Date: Wed May 16 15:22:53 2007
New Revision: 538764

URL: http://svn.apache.org/viewvc?view=rev&rev=538764
Log:
Updates to get the right wrapper classnames

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
    incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
    incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Wed May 16 15:22:53 2007
@@ -413,6 +413,34 @@
     }
 
     @Override
+    public String getResponseWrapperClassName(Method selected) {
+        Method m = getDeclaredMethod(selected);
+
+        ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class);
+        String clsName = "";
+        if (rw != null) {
+            clsName = rw.className();
+        }
+        if (clsName.length() > 0) {
+            return clsName;
+        }
+        return null;
+    }
+    public String getRequestWrapperClassName(Method selected) {
+        Method m = getDeclaredMethod(selected);
+
+        RequestWrapper rw = m.getAnnotation(RequestWrapper.class);
+        String clsName = "";
+        if (rw != null) {
+            clsName = rw.className();
+        }
+        if (clsName.length() > 0) {
+            return clsName;
+        }
+        return null;
+    }
+    
+    @Override
     public Class getRequestWrapper(Method selected) {
         Method m = getDeclaredMethod(selected);
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Wed May 16 15:22:53 2007
@@ -220,10 +220,18 @@
         if (responseWrapper != null) {
             o.getOutput().getMessageParts().get(0).setTypeClass(responseWrapper);
         }
+        if (getResponseWrapperClassName(selected) != null) {
+            o.getOutput().getMessageParts().get(0).setProperty("RESPONSE.WRAPPER.CLASSNAME",
+                                                           getResponseWrapperClassName(selected));
+        }
         Class<?> requestWrapper = getRequestWrapper(selected);
         if (requestWrapper != null) {
             o.getInput().getMessageParts().get(0).setTypeClass(requestWrapper);
         }
+        if (getRequestWrapperClassName(selected) != null) {
+            o.getInput().getMessageParts().get(0).setProperty("REQUEST.WRAPPER.CLASSNAME",
+                                                           getRequestWrapperClassName(selected));
+        }
     }
 
     /**
@@ -319,12 +327,14 @@
                 MessageInfo input = o.getInput();
                 MessagePartInfo part = input.getMessageParts().get(0);                
                 part.setTypeClass(getRequestWrapper(method));
+                part.setProperty("REQUEST.WRAPPER.CLASSNAME", getRequestWrapperClassName(method));
             }
 
             if (o.hasOutput()) {
                 MessageInfo input = o.getOutput();
                 MessagePartInfo part = input.getMessageParts().get(0);                
                 part.setTypeClass(getResponseWrapper(method));
+                part.setProperty("RESPONSE.WRAPPER.CLASSNAME", getResponseWrapperClassName(method));
                 part.setIndex(-1);
             }
 

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
Wed May 16 15:22:53 2007
@@ -160,6 +160,12 @@
     public Class getRequestWrapper(Method selected) {
         return null;
     }
+    public String getResponseWrapperClassName(Method selected) {
+        return null;
+    }
+    public String getRequestWrapperClassName(Method selected) {
+        return null;
+    }
     
     public Boolean isRPC(Method selected) {
         return null;

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed May 16 15:22:53 2007
@@ -754,6 +754,8 @@
         }
         if (getRequestWrapper(method) != null) {
             part.setTypeClass(this.getRequestWrapper(method));
+        } else if (getRequestWrapperClassName(method) != null) {
+            part.setProperty("REQUEST.WRAPPER.CLASSNAME", getRequestWrapperClassName(method));
         }
 
         for (MessagePartInfo mpart : op.getInput().getMessageParts()) {
@@ -785,6 +787,8 @@
 
         if (this.getResponseWrapper(method) != null) {
             part.setTypeClass(this.getResponseWrapper(method));
+        } else if (getResponseWrapperClassName(method) != null) {
+            part.setProperty("RESPONSE.WRAPPER.CLASSNAME", getResponseWrapperClassName(method));
         }
     }
 
@@ -1157,6 +1161,15 @@
         }
         return null;
     }
+    protected String getResponseWrapperClassName(Method selected) {
+        for (AbstractServiceConfiguration c : serviceConfigurations) {
+            String cls = c.getResponseWrapperClassName(selected);
+            if (cls != null) {
+                return cls;
+            }
+        }
+        return null;
+    }
 
     protected Class getRequestWrapper(Method selected) {
         for (AbstractServiceConfiguration c : serviceConfigurations) {
@@ -1167,7 +1180,16 @@
         }
         return null;
     }
-
+    protected String getRequestWrapperClassName(Method selected) {
+        for (AbstractServiceConfiguration c : serviceConfigurations) {
+            String cls = c.getRequestWrapperClassName(selected);
+            if (cls != null) {
+                return cls;
+            }
+        }
+        return null;
+    }
+    
     protected SimpleMethodDispatcher getMethodDispatcher() {
         return methodDispatcher;
     }

Modified: incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
Wed May 16 15:22:53 2007
@@ -36,12 +36,13 @@
     public void setOperationInfo(final OperationInfo op) {
         super.setOperationInfo(op);
         setName(op.getInput().getMessageParts().get(0).getElementQName());
+        setClassName((String)op.getInput().getMessageParts().get(0).getProperty("REQUEST.WRAPPER.CLASSNAME"));
     }
 
     @Override
     public boolean isWrapperAbsent(final Method method) {
         javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class);
-        return reqWrapper == null || StringUtils.isEmpty(reqWrapper.className());
+        return getClassName() == null && (reqWrapper == null || StringUtils.isEmpty(reqWrapper.className()));
     }
 
     @Override
@@ -79,13 +80,14 @@
     @Override
     public WrapperBeanClass getWrapperBeanClass(final Method method) {
         javax.xml.ws.RequestWrapper reqWrapper = method.getAnnotation(javax.xml.ws.RequestWrapper.class);
-        String reqClassName = "";
+        String reqClassName = getClassName();
         String reqNs = null;
         
-        if (!isWrapperAbsent(method)) {
+        if (reqWrapper != null) {
             reqClassName = reqWrapper.className().length() > 0 ? reqWrapper.className()
: reqClassName;
-            reqNs = reqWrapper.targetNamespace();
-        } else {
+            reqNs = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace()
: null;
+        } 
+        if (reqClassName == null) {
             reqClassName = getPackageName(method) + ".jaxws." + AnnotationUtil.capitalize(method.getName());
         }
 

Modified: incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
Wed May 16 15:22:53 2007
@@ -38,12 +38,14 @@
     public void setOperationInfo(final OperationInfo op) {
         super.setOperationInfo(op);
         setName(op.getOutput().getMessageParts().get(0).getElementQName());
+        setClassName((String)op.getOutput().getMessageParts().get(0)
+                         .getProperty("RESPONSE.WRAPPER.CLASSNAME"));
     }
    
     @Override
     public boolean isWrapperAbsent(final Method method) {
         javax.xml.ws.ResponseWrapper resWrapper = method.getAnnotation(javax.xml.ws.ResponseWrapper.class);
-        return resWrapper == null || StringUtils.isEmpty(resWrapper.className());
+        return getClassName() == null && (resWrapper == null || StringUtils.isEmpty(resWrapper.className()));
     }
 
     @Override
@@ -103,13 +105,14 @@
     @Override
     public WrapperBeanClass getWrapperBeanClass(final Method method) {
         javax.xml.ws.ResponseWrapper resWrapper = method.getAnnotation(javax.xml.ws.ResponseWrapper.class);
-        String resClassName = "";
+        String resClassName = getClassName();
         String resNs = null;
         
-        if (!isWrapperAbsent(method)) {
-            resClassName = resWrapper.className();
-            resNs = resWrapper.targetNamespace();
-        } else {
+        if (resWrapper != null) {
+            resClassName = resWrapper.className().length() > 0 ? resWrapper.className()
: resClassName;
+            resNs = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace()
: null;
+        }  
+        if (resClassName == null) {
             resClassName = getPackageName(method) + ".jaxws." 
                 + AnnotationUtil.capitalize(method.getName())
                 + "Response";

Modified: incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java?view=diff&rev=538764&r1=538763&r2=538764
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
Wed May 16 15:22:53 2007
@@ -48,6 +48,7 @@
     private boolean isSamePackage;
 
     private OperationInfo operationInfo;
+    private String className;
 
     public void setOperationInfo(final OperationInfo op) {
         this.operationInfo = op;
@@ -60,6 +61,12 @@
 
     public void setName(QName n) {
         this.name = n;
+    }
+    public void setClassName(String s) {
+        className = s;
+    }
+    public String getClassName() {
+        return className;
     }
 
     public WrapperBeanClass getWrapperBeanClass(final Method m) {



Mime
View raw message