ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
Date Sun, 01 May 2005 19:39:25 GMT
dims        2005/05/01 12:39:25

  Modified:    java/src/org/apache/axis/encoding/ser ArraySerializer.java
                        ArraySerializerFactory.java
               java/test/wsdl/echo ComplexEchoServiceTestCase.java
               java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
  Log:
  Got the client-side working for (AXIS-1926) wrapped document/literal generates wrong SOAP
message for arrays within arrays
  
  Revision  Changes    Path
  1.67      +17 -4     ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- ArraySerializer.java	27 Apr 2005 13:37:35 -0000	1.66
  +++ ArraySerializer.java	1 May 2005 19:39:25 -0000	1.67
  @@ -54,6 +54,7 @@
       QName xmlType;
       Class javaType;
       QName componentType;
  +    QName componentQName;
   
       /**
        * Constructor
  @@ -74,6 +75,17 @@
           this.componentType = componentType;
       }
   
  +    /**
  +     * Constructor
  +     * Special constructor that takes the component type and QName of the array.
  +     */
  +    public ArraySerializer(Class javaType, QName xmlType, QName componentType, QName componentQName)
{
  +        this.javaType = javaType;
  +        this.xmlType = xmlType;
  +        this.componentType = componentType;
  +        this.componentQName = componentQName;
  +    }
  +
       protected static Log log =
           LogFactory.getLog(ArraySerializer.class.getName());
   
  @@ -262,8 +274,8 @@
           // actual schema array or for a maxOccurs usage.
           // For the maxOccurs case, the currentXMLType of the context is
           // the same as the componentTypeQName.
  -        QName componentQName = context.getItemQName();
  -        boolean maxOccursUsage = !encoded && componentQName == null &&
  +        QName itemQName = context.getItemQName();
  +        boolean maxOccursUsage = !encoded && itemQName == null &&
                   componentTypeQName.equals(context.getCurrentXMLType());
   
           if (encoded) {
  @@ -358,9 +370,10 @@
           if (!maxOccursUsage) {
               serializeAttr = null;  // since we are putting them here
               context.startElement(name, attributes);
  -            if (componentQName != null)
  +            if (itemQName != null)
  +                elementName = itemQName;
  +            else if(componentQName != null)
                   elementName = componentQName;
  -            // If we are doing SOAP encoded arrays, no need to add xsi:type to the items
           }
   
   
  
  
  
  1.12      +9 -1      ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializerFactory.java
  
  Index: ArraySerializerFactory.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializerFactory.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ArraySerializerFactory.java	18 Nov 2004 15:26:15 -0000	1.11
  +++ ArraySerializerFactory.java	1 May 2005 19:39:25 -0000	1.12
  @@ -36,11 +36,19 @@
       }
   
       private QName componentType;
  +    private QName componentQName;
  +
       public ArraySerializerFactory(QName componentType) {
           super(ArraySerializer.class, Constants.SOAP_ARRAY, Object[].class);
           this.componentType = componentType;
       }
   
  +    public ArraySerializerFactory(QName componentType, QName componentQName) {
  +        super(ArraySerializer.class, Constants.SOAP_ARRAY, Object[].class);
  +        this.componentType = componentType;
  +        this.componentQName = componentQName;
  +    }
  +
       /**
        * Obtains a serializer by invoking <constructor>(javaType, xmlType)
        * on the serClass.
  @@ -52,6 +60,6 @@
           if (componentType == null)
               return super.getGeneralPurpose(mechanismType);
           else
  -            return new ArraySerializer(javaType, xmlType, componentType);
  +            return new ArraySerializer(javaType, xmlType, componentType, componentQName);
       }
   }
  
  
  
  1.7       +2 -2      ws-axis/java/test/wsdl/echo/ComplexEchoServiceTestCase.java
  
  Index: ComplexEchoServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/echo/ComplexEchoServiceTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ComplexEchoServiceTestCase.java	1 May 2005 04:33:39 -0000	1.6
  +++ ComplexEchoServiceTestCase.java	1 May 2005 19:39:25 -0000	1.7
  @@ -98,8 +98,8 @@
           });
           // Test operation
           test.wsdl.echo.NamedValue[] value = null;
  -        //TODO: Fix this
  -        //value = binding.echo2(request);
  +
  +        value = binding.echo2(request);
           // TBD - validate results
       }
   }
  
  
  
  1.149     +10 -1     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- JavaStubWriter.java	1 May 2005 15:02:50 -0000	1.148
  +++ JavaStubWriter.java	1 May 2005 19:39:25 -0000	1.149
  @@ -894,6 +894,7 @@
   
           pw.println("            java.lang.Class cls;");
           pw.println("            javax.xml.namespace.QName qName;");
  +        pw.println("            javax.xml.namespace.QName qName2;");
           pw.println(
                   "            java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;");
           pw.println(
  @@ -962,10 +963,18 @@
                   // Both factories must be an instance, so we create a ArrayDeserializerFactory
                   if (type.getComponentType() != null) {
                       QName ct = type.getComponentType();
  +                    QName name = type.getItemQName();
                       pw.println("            qName = new javax.xml.namespace.QName(\""
                               + ct.getNamespaceURI() + "\", \"" + ct.getLocalPart()
                               + "\");");
  -                    pw.println("            cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName));");
  +                    if(name != null) {
  +                        pw.println("            qName2 = new javax.xml.namespace.QName(\""
  +                                + name.getNamespaceURI() + "\", \"" + name.getLocalPart()
  +                                + "\");");
  +                    } else {
  +                        pw.println("            qName2 = null;");
  +                    }
  +                    pw.println("            cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName,
qName2));");
                       pw.println("            cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory());");
                   } else {
                       pw.println("            cachedSerFactories.add(arraysf);");
  
  
  

Mime
View raw message