geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r164247 - in /geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder: HeavyweightOperationDescBuilder.java HeavyweightTypeInfoBuilder.java LightweightOperationDescBuilder.java LightweightTypeInfoBuilder.java
Date Fri, 22 Apr 2005 15:15:32 GMT
Author: gdamour
Date: Fri Apr 22 08:15:31 2005
New Revision: 164247

URL: http://svn.apache.org/viewcvs?rev=164247&view=rev
Log:
Slightly change the way the FieldDesc of a TypeDesc are built:

o Lightweight type info modification: use the raw QName of the element 
specified in the SchemaType associated to the TypeDesc being built as the 
FieldDesc XmlName.
The previous implementation was using the namespace of the SchemaType and
the local part name of the element.

o Heavyweight type info modification: try "" for the namespace and the
local part name of the element as specified in the explicit mapping. If 
the resulting QName exists in the SchemaType associated to the type info
being built, then use this name.
Otherwise, try the namespace of the SchemaType associated to the type info
being built.

o remove the FieldDesc.setJavaType calls as Axis does not use then.

Also, fix a couple of copyrights.

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightTypeInfoBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightTypeInfoBuilder.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java?rev=164247&r1=164246&r2=164247&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
Fri Apr 22 08:15:31 2005
@@ -1,6 +1,6 @@
 /**
  *
- * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -60,6 +60,9 @@
 import org.objectweb.asm.Type;
 import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType;
 
+/**
+ * @version $Rev$ $Date$
+ */
 public class HeavyweightOperationDescBuilder extends OperationDescBuilder {
 
     private final JavaWsdlMappingType mapping;
@@ -477,9 +480,8 @@
                 if (part == null) {
                     throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName
+ " in output message for operation " + operationName);
                 }
-                returnQName = part.getElementName();
-                //TODO mirror the Axis behavior. Why?
-                returnType = new QName(returnQName.getNamespaceURI(), ">" + returnQName.getLocalPart());
+                returnQName = getPartName(part);
+                returnType = returnQName;
             }
 
             outParamNames.add(wsdlMessagePartName);
@@ -546,9 +548,8 @@
                 if (part == null) {
                     throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName
+ " in input message for operation " + operationName);
                 }
-                paramQName = part.getElementName();
-                //TODO mirror the Axis behavior. Why?
-                paramTypeQName = new QName(paramQName.getNamespaceURI(), ">" + paramQName.getLocalPart());
+                paramQName = getPartName(part);
+                paramTypeQName = paramQName;
             }
             inParamNames.add(wsdlMessagePartName);
             if (isOutParam) {
@@ -580,9 +581,8 @@
                     if (part == null) {
                         throw new DeploymentException("No part for wsdlMessagePartName "
+ wsdlMessagePartName + " in output message for operation " + operationName);
                     }
-                    paramQName = part.getElementName();
-                    //TODO mirror the Axis behavior. Why?
-                    paramTypeQName = new QName(paramQName.getNamespaceURI(), ">" + paramQName.getLocalPart());
+                    paramQName = getPartName(part);
+                    paramTypeQName = paramQName;
                 }
                 outParamNames.add(wsdlMessagePartName);
             }
@@ -612,9 +612,8 @@
                 if (part == null) {
                     throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName
+ " in output message for operation " + operationName);
                 }
-                paramQName = part.getElementName();
-                //TODO mirror the Axis behavior. Why?
-                paramTypeQName = new QName(paramQName.getNamespaceURI(), ">" + paramQName.getLocalPart());
+                paramQName = getPartName(part);
+                paramTypeQName = paramQName;
             }
             outParamNames.add(wsdlMessagePartName);
         } else {
@@ -631,6 +630,10 @@
         return parameterDesc;
     }
 
+    private QName getPartName(Part part) {
+        return null == part.getElementName()? part.getTypeName() : part.getElementName();
+    }
+    
     private Part getWrappedPart(Message message) throws DeploymentException {
         // in case of wrapped element, the message has only one part.
         Collection parts = message.getParts().values();

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightTypeInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightTypeInfoBuilder.java?rev=164247&r1=164246&r2=164247&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightTypeInfoBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightTypeInfoBuilder.java
Fri Apr 22 08:15:31 2005
@@ -139,9 +139,10 @@
             throw new DeploymentException("Schema type key " + key + " not found in analyzed
schema: " + schemaTypeKeyToSchemaTypeMap);
         }
         String ns = key.getqName().getNamespaceURI();
-        
+                
         typeInfo.setCanSearchParents(schemaType.getDerivationType() == SchemaType.DT_RESTRICTION);
         
+        
         Map nameToType = new HashMap();
         if (null  == schemaType.getContentModel()) {
             ;
@@ -149,13 +150,11 @@
             SchemaParticle[] properties = schemaType.getContentModel().getParticleChildren();
             for (int i = 0; i < properties.length; i++) {
                 SchemaParticle parameter = properties[i];
-                // TODO why the ns of parameter.getName() is wrong?
-                nameToType.put(new QName(ns, parameter.getName().getLocalPart()) , parameter);
+                nameToType.put(parameter.getName(), parameter);
             }
         } else if (SchemaParticle.ELEMENT == schemaType.getContentModel().getParticleType())
{
             SchemaParticle parameter = schemaType.getContentModel();
-            // TODO why the ns of parameter.getName() is wrong?
-            nameToType.put(new QName(ns, parameter.getName().getLocalPart()) , parameter);
+            nameToType.put(parameter.getName(), parameter);
         } else {
             throw new DeploymentException("Only sequence particle types are supported." +
                     " SchemaType name =" + schemaType.getName());
@@ -187,7 +186,6 @@
                 if (javaType == null) {
                     throw new DeploymentException("field name " + fieldName + " not found
in " + properties);
                 }
-                attributeDesc.setJavaType(javaType);
                 QName xmlName = new QName("", variableMapping.getXmlAttributeName().getStringValue().trim());
                 attributeDesc.setXmlName(xmlName);
                 // TODO retrieve the type of the attribute.
@@ -207,12 +205,14 @@
                         throw new DeploymentException("field name " + fieldName + " not found
in " + properties);
                     }
                 }
-                elementDesc.setJavaType(javaType);
-                
-                QName xmlName = new QName(ns, variableMapping.getXmlElementName().getStringValue().trim());
+                QName xmlName = new QName("", variableMapping.getXmlElementName().getStringValue().trim());
                 SchemaParticle particle = (SchemaParticle) nameToType.get(xmlName);
                 if (null == particle) {
-                    throw new DeploymentException("element " + xmlName + " not found in schema
" + schemaType.getName());
+                    xmlName = new QName(ns, variableMapping.getXmlElementName().getStringValue().trim());
+                    particle = (SchemaParticle) nameToType.get(xmlName);
+                    if (null == particle) {
+                        throw new DeploymentException("element " + xmlName + " not found
in schema " + schemaType.getName());
+                    }
                 } else if (SchemaParticle.ELEMENT != particle.getParticleType()) {
                     throw new DeploymentException(xmlName + " is not an element in schema
" + schemaType.getName());
                 }

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java?rev=164247&r1=164246&r2=164247&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
Fri Apr 22 08:15:31 2005
@@ -1,6 +1,6 @@
 /**
  *
- * Copyright 2003-2004 The Apache Software Foundation
+ * Copyright 2005 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -23,9 +23,6 @@
 import javax.xml.namespace.QName;
 import javax.wsdl.Part;
 import javax.wsdl.BindingOperation;
-import javax.wsdl.Operation;
-import javax.wsdl.Message;
-import javax.wsdl.extensions.soap.SOAPOperation;
 
 import org.apache.geronimo.axis.client.OperationInfo;
 import org.apache.geronimo.common.DeploymentException;
@@ -36,6 +33,9 @@
 import org.apache.axis.constants.Use;
 import org.objectweb.asm.Type;
 
+/**
+ * @version $Rev$ $Date$
+ */
 public class LightweightOperationDescBuilder extends OperationDescBuilder {
 
     private final Method method;

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightTypeInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightTypeInfoBuilder.java?rev=164247&r1=164246&r2=164247&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightTypeInfoBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightTypeInfoBuilder.java
Fri Apr 22 08:15:31 2005
@@ -103,8 +103,6 @@
         if (schemaType == null) {
             throw new DeploymentException("Schema type key " + key + " not found in analyzed
schema: " + schemaTypeKeyToSchemaTypeMap);
         }
-        String ns = key.getqName().getNamespaceURI();
-
         typeInfo.setCanSearchParents(schemaType.getDerivationType() == SchemaType.DT_RESTRICTION);
 
         Map nameToType = new HashMap();
@@ -117,13 +115,11 @@
                 if (SchemaParticle.ELEMENT != parameter.getType().getContentModel().getParticleType())
{
                     throw new DeploymentException(parameter.getName() + " is not an element
in schema " + schemaType.getName());
                 }
-                // TODO why the ns of parameter.getName() is wrong?
-                nameToType.put(new QName(ns, parameter.getName().getLocalPart()) , parameter);
+                nameToType.put(parameter.getName(), parameter);
             }
         } else if (SchemaParticle.ELEMENT == schemaType.getContentModel().getParticleType())
{
             SchemaParticle parameter = schemaType.getContentModel();
-            // TODO why the ns of parameter.getName() is wrong?
-            nameToType.put(new QName(ns, parameter.getName().getLocalPart()) , parameter);
+            nameToType.put(parameter.getName(), parameter);
         } else {
             throw new DeploymentException("Only all, choice and sequence particle types are
supported." +
                     " SchemaType name =" + schemaType.getName());
@@ -155,7 +151,6 @@
             if (null == javaType) {
                 throw new DeploymentException("Field " + fieldName + " is not defined by
class " + javaClass.getName());
             }
-            elementDesc.setJavaType(javaType);
             elementDesc.setNillable(particle.isNillable());
             elementDesc.setXmlName(fieldName);
             elementDesc.setXmlType(particle.getType().getName());



Mime
View raw message