cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r591431 - in /incubator/cxf/trunk: distribution/ distribution/manifest/ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/
Date Fri, 02 Nov 2007 19:31:32 GMT
Author: dkulp
Date: Fri Nov  2 12:31:28 2007
New Revision: 591431

URL: http://svn.apache.org/viewvc?rev=591431&view=rev
Log:
[CXF-1222]Try to find inner classes for the wrapper types
Add ant jar to lib so dynamic client will work

Modified:
    incubator/cxf/trunk/distribution/manifest/pom.xml
    incubator/cxf/trunk/distribution/pom.xml
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java

Modified: incubator/cxf/trunk/distribution/manifest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/manifest/pom.xml?rev=591431&r1=591430&r2=591431&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/manifest/pom.xml (original)
+++ incubator/cxf/trunk/distribution/manifest/pom.xml Fri Nov  2 12:31:28 2007
@@ -236,7 +236,13 @@
         <dependency>
             <groupId>commons-httpclient</groupId>
             <artifactId>commons-httpclient</artifactId>
-        </dependency>        
+        </dependency>    
+
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

Modified: incubator/cxf/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/pom.xml?rev=591431&r1=591430&r2=591431&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/pom.xml (original)
+++ incubator/cxf/trunk/distribution/pom.xml Fri Nov  2 12:31:28 2007
@@ -247,6 +247,10 @@
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
         </dependency>
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=591431&r1=591430&r2=591431&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Fri Nov  2 12:31:28 2007
@@ -312,7 +312,6 @@
         try {
             int i = Integer.valueOf(minor);
             if (i >= 1) {
-                System.out.println("Found JAXB 2.1");
                 return true;
             }
         } catch (NumberFormatException e) {

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java?rev=591431&r1=591430&r2=591431&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
Fri Nov  2 12:31:28 2007
@@ -23,6 +23,7 @@
 
 import javax.xml.namespace.QName;
 
+import com.sun.codemodel.JDefinedClass;
 import com.sun.codemodel.JType;
 import com.sun.tools.xjc.api.Mapping;
 import com.sun.tools.xjc.api.S2JJAXBModel;
@@ -37,6 +38,8 @@
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.service.model.UnwrappedOperationInfo;
+import org.apache.ws.commons.schema.XmlSchemaElement;
 
 public class TypeClassInitializer extends ServiceModelVisitor {
     private static final Logger LOG = LogUtils.getL7dLogger(TypeClassInitializer.class);
@@ -66,9 +69,7 @@
         //String clsName = null;
         JType jType = null;
         if (mapping != null) {
-            
             jType = mapping.getType().getTypeClass();              
-            
         }
         
         if (jType == null) {
@@ -77,6 +78,32 @@
                 jType = typeAndAnnotation.getTypeClass();
             }
         }
+        if (jType == null 
+            && part.isElement()
+            && part.getXmlSchema() instanceof XmlSchemaElement
+            && ((XmlSchemaElement)part.getXmlSchema()).getSchemaTypeName() == null)
{
+            //anonymous inner thing.....
+            UnwrappedOperationInfo oInfo = (UnwrappedOperationInfo)op;
+            op = oInfo.getWrappedOperation();
+            
+            if (part.getMessageInfo() == oInfo.getInput()) {
+                mapping = model.get(op.getInput().getMessagePart(0).getElementQName());
+            } else {
+                mapping = model.get(op.getOutput().getMessagePart(0).getElementQName());
+            }
+            if (mapping != null) {
+                jType = mapping.getType().getTypeClass();  
+                if (jType instanceof JDefinedClass) {
+                    JDefinedClass jdType = (JDefinedClass)jType;
+                    for (JType jt : jdType.listClasses()) {
+                        if (jt.name().equalsIgnoreCase(part.getElementQName().getLocalPart()))
{
+                            jType = jt;
+                        }
+                    }
+                }
+            }
+            
+        }
         
         if (jType == null) {
             throw new ServiceConstructionException(new Message("NO_JAXB_CLASS", LOG, name));
@@ -116,7 +143,7 @@
         Class cls;
         
         if (!jType.isPrimitive()) {
-            cls = ClassLoaderUtils.loadClass(jType.fullName(), getClass());
+            cls = ClassLoaderUtils.loadClass(jType.binaryName(), getClass());
         } else {
             cls = PrimitiveUtils.getClass(jType.fullName());
         }



Mime
View raw message