gdaniels    2002/06/18 09:53:10

  Modified:    java/src/org/apache/axis/encoding/ser ArrayDeserializer.java
               java/src/org/apache/axis/encoding DeserializerImpl.java
               java/test/wsdl/types DynamicProxyTestCase.java
               java/src/org/apache/axis/message RPCHandler.java
               java/src/org/apache/axis/wsdl/symbolTable Utils.java
  Log:
  Fix bug where we weren't deserializing arrays correctly in cases where
  a) there were no xsi:type or SOAP-ENC:ArrayType attributes on the array,
  and b) we knew the specific array type through metadata.
  
  We now (in RPCHandler) always set the default type in the deserializer
  we get for each RPC parameter.  This gets used by the array
  deserializer so it knows it's "real" type even if there are no attributes
  on the array element.
  
  Also some cleanup of dead code and replacing of javax.xml.rpc.
  namespace.QName with javax.xml.namespace.QName.
  
  Revision  Changes    Path
  1.18      +6 -2      
xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java
  
  Index: ArrayDeserializer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ArrayDeserializer.java    11 Jun 2002 14:53:55 -0000      1.17
  +++ ArrayDeserializer.java    18 Jun 2002 16:53:10 -0000      1.18
  @@ -152,12 +152,16 @@
           QName typeQName = context.getTypeFromAttributes(namespace,
                                                           localName,
                                                           attributes);
  -        if (typeQName != null && 
  +        if (typeQName == null) {
  +            typeQName = getDefaultType();
  +        }
  +
  +        if (typeQName != null &&
               Constants.equals(Constants.SOAP_ARRAY, typeQName)) {
               typeQName = null;
           }
   
  -        // Now get the arrayType value 
  +        // Now get the arrayType value
           QName arrayTypeValue = context.getQNameFromString(
                         Constants.getValue(attributes,
                                            Constants.URIS_SOAP_ENC,
  
  
  
  1.18      +1 -6      xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java
  
  Index: DeserializerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DeserializerImpl.java     11 Jun 2002 14:53:54 -0000      1.17
  +++ DeserializerImpl.java     18 Jun 2002 16:53:10 -0000      1.18
  @@ -267,8 +267,6 @@
           }
       }
       
  -    private int startIdx = 0;
  -    private int endIdx = -1;
       protected boolean isHref = false;
       protected boolean isNil  = false;  // xsd:nil attribute is set to true
       protected String id = null;  // Set to the id of the element
  @@ -449,8 +447,6 @@
                       throw new SAXException(
                                              JavaUtils.getMessage("noDeser00", "" + 
type));
                   }
  -            } else {
  -                startIdx = context.getCurrentRecordPos();
               }
           }
       }
  @@ -536,8 +532,7 @@
           if (this.getClass().equals(DeserializerImpl.class) &&
               targets != null &&
               !targets.isEmpty()) {
  -            endIdx = context.getCurrentRecordPos();
  -            
  +
               StringWriter writer = new StringWriter();
               SerializationContextImpl serContext = 
                           new SerializationContextImpl(writer,
  
  
  
  1.6       +2 -2      xml-axis/java/test/wsdl/types/DynamicProxyTestCase.java
  
  Index: DynamicProxyTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/types/DynamicProxyTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DynamicProxyTestCase.java 11 Jun 2002 14:54:04 -0000      1.5
  +++ DynamicProxyTestCase.java 18 Jun 2002 16:53:10 -0000      1.6
  @@ -1163,8 +1163,8 @@
           assertTrue("binding is null", binding != null);
   
           try {
  -            javax.xml.rpc.namespace.QName value = null;
  -            value = binding.methodQName(new 
javax.xml.rpc.namespace.QName("http://double-double";, "toil-and-trouble"), new 
QNameHolder(new javax.xml.rpc.namespace.QName("http://double-double";, 
"toil-and-trouble")));
  +            javax.xml.namespace.QName value = null;
  +            value = binding.methodQName(new 
javax.xml.namespace.QName("http://double-double";, "toil-and-trouble"), new 
QNameHolder(new javax.xml.namespace.QName("http://double-double";, 
"toil-and-trouble")));
           }
           catch (java.rmi.RemoteException re) {
               throw new junit.framework.AssertionFailedError("Remote Exception 
caught: " + re);
  
  
  
  1.47      +2 -0      xml-axis/java/src/org/apache/axis/message/RPCHandler.java
  
  Index: RPCHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- RPCHandler.java   11 Jun 2002 14:53:59 -0000      1.46
  +++ RPCHandler.java   18 Jun 2002 16:53:10 -0000      1.47
  @@ -232,6 +232,8 @@
                       "noDeser01", localName,"" + type));
           }
   
  +        dser.setDefaultType(type);
  +
           dser.registerValueTarget(
                new FieldTarget(currentParam,
                    RPCParam.getValueField()));
  
  
  
  1.13      +2 -2      xml-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java
  
  Index: Utils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Utils.java        11 Jun 2002 14:54:01 -0000      1.12
  +++ Utils.java        18 Jun 2002 16:53:10 -0000      1.13
  @@ -548,7 +548,7 @@
   
       /**
        * Given the WSDL4J QName (javax.wsdl.QName), return the JAX-RPC
  -     * QName (javax.xml.rpc.namespace.QName).
  +     * QName (javax.xml.namespace.QName).
        */
       public static javax.xml.namespace.QName getAxisQName(QName qname)
       {
  @@ -560,7 +560,7 @@
       }
   
       /**
  -     * Given the JAX-RPC QName (javax.xml.rpc.namespace.QName), return
  +     * Given the JAX-RPC QName (javax.xml.namespace.QName), return
        * the WSDL4J QName (javax.wsdl.QName).
        */
       public static QName getWSDLQName(javax.xml.namespace.QName qname)
  
  
  


Reply via email to