scheu       02/04/05 08:15:37

  Modified:    java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis/encoding
                        DefaultTypeMappingImpl.java
               java/src/org/apache/axis/encoding/ser HexSerializer.java
               java/src/org/apache/axis/message RPCParam.java
               java/src/org/apache/axis/utils resources.properties
  Log:
  
  A) Made a minor change to Call.getParamList.
  The ParameterDesc is set on the RPCParam object.
  (I am not sure why this was not happening before,
  might be an oversight.)
  
  B) Changed the RPCParam.serialize method to
  use the ParameterDesc information (if available)
  to invoke context.serialize.  The code is changed
  to invoke the serialize method passing in the
  xmlType specified in the stub.
  
  The effect is that if the stub says to
  serialize a String as a soapenc:string, the
  runtime will serialize it as a soapenc:string (not
  an xsd:string).
  
  I also made a couple of other changes to fix
  minor exposed bugs.
  
   - Small change to DefaultTypeMapping to
     set the serializers for SOAP primitives.
  
   - Small change to the HexSerializer to
     convert the input value to a class compatible with the
     javaType.
  
  Ran all-tests and also ran my copy of the
  nightly interop tests.
  
  Revision  Changes    Path
  1.112     +4 -0      xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- Call.java 27 Mar 2002 20:24:06 -0000      1.111
  +++ Call.java 5 Apr 2002 16:15:37 -0000       1.112
  @@ -1364,6 +1364,10 @@
               RPCParam p = new RPCParam(paramQName.getNamespaceURI(),
                                         paramQName.getLocalPart(),
                                         params[j++] );
  +            // Attach the ParameterDescription to the RPCParam
  +            // so that the serializer can use the (javaType, xmlType) 
  +            // information.
  +            p.setParamDesc(param);
               result.add( p );
           }
   
  
  
  
  1.18      +10 -10    
xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java
  
  Index: DefaultTypeMappingImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DefaultTypeMappingImpl.java       3 Apr 2002 01:23:58 -0000       1.17
  +++ DefaultTypeMappingImpl.java       5 Apr 2002 16:15:37 -0000       1.18
  @@ -149,25 +149,25 @@
           // Note that only deserializing is supported since we are flowing
           // SOAP 1.1 over the wire.
           myRegister(Constants.SOAP_STRING,     java.lang.String.class,
  -                   null, null, true,  true);
  +                   null, null, true);
           myRegister(Constants.SOAP_BOOLEAN,    java.lang.Boolean.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_DOUBLE,     java.lang.Double.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_FLOAT,      java.lang.Float.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_INT,        java.lang.Integer.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_INTEGER,    java.math.BigInteger.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_DECIMAL,    java.math.BigDecimal.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_LONG,       java.lang.Long.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_SHORT,      java.lang.Short.class,
  -                   null, null, false, true);
  +                   null, null, false);
           myRegister(Constants.SOAP_BYTE,       java.lang.Byte.class,
  -                   null, null, false, true);
  +                   null, null, false);
   
           // Hex binary data needs to use the hex binary serializer/deserializer
           myRegister(Constants.XSD_HEXBIN,     Hex.class,
  
  
  
  1.4       +3 -0      
xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializer.java
  
  Index: HexSerializer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HexSerializer.java        8 Feb 2002 23:18:53 -0000       1.3
  +++ HexSerializer.java        5 Apr 2002 16:15:37 -0000       1.4
  @@ -74,6 +74,7 @@
   import org.w3c.dom.Element;
   import org.w3c.dom.Document;
   import org.apache.axis.encoding.Base64;
  +import org.apache.axis.utils.JavaUtils;
   /**
    * Serializer for hexBinary.
    *
  @@ -98,6 +99,8 @@
           throws IOException
       {
           context.startElement(name, attributes);
  +        
  +        value = JavaUtils.convert(value, javaType);
           if (javaType == Hex.class) {
               context.writeString(((Hex) value).toString());
           } else {
  
  
  
  1.36      +16 -4     xml-axis/java/src/org/apache/axis/message/RPCParam.java
  
  Index: RPCParam.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCParam.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- RPCParam.java     22 Mar 2002 16:08:32 -0000      1.35
  +++ RPCParam.java     5 Apr 2002 16:15:37 -0000       1.36
  @@ -155,10 +155,22 @@
       public void serialize(SerializationContext context)
           throws IOException
       {
  -        if (value != null) {
  -            context.serialize(qname, null, value, value.getClass());
  -        } else {
  -            context.serialize(qname, null, value, null);
  +        // Set the javaType to value's class unless 
  +        // parameter description information exists.
  +        // Set the xmlType using the parameter description
  +        // information.  (an xmlType=null causes the
  +        // serialize method to search for a compatible xmlType)
  +        Class javaType = value == null ? null: value.getClass();
  +        QName xmlType = null;
  +        if (paramDesc != null) {
  +            javaType = paramDesc.getJavaType() != null ? 
  +                paramDesc.getJavaType(): javaType;
  +            xmlType = paramDesc.getTypeQName();
           }
  +        context.serialize(qname,  // element qname
  +                          null,   // no extra attrs
  +                          value,  // value
  +                          javaType, xmlType, // java/xml type
  +                          true, true); 
       }
   }
  
  
  
  1.87      +1 -1      xml-axis/java/src/org/apache/axis/utils/resources.properties
  
  Index: resources.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- resources.properties      31 Mar 2002 04:15:31 -0000      1.86
  +++ resources.properties      5 Apr 2002 16:15:37 -0000       1.87
  @@ -795,4 +795,4 @@
   badParameterMode=Invalid parameter mode byte ({0}) passed to getModeAsString().
   
   attach.bounday.mns=Marking streams not supported.
  -noSuchOperation=No such operation ''{0}''
  \ No newline at end of file
  +noSuchOperation=No such operation ''{0}''
  
  
  


Reply via email to