[ 
https://issues.apache.org/jira/browse/AXIS-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen updated AXIS-1886:
----------------------------------

    Labels: multiref-insanity  (was: )
    
> Axis serializes xsd:int as multiRef
> -----------------------------------
>
>                 Key: AXIS-1886
>                 URL: https://issues.apache.org/jira/browse/AXIS-1886
>             Project: Axis
>          Issue Type: Bug
>          Components: Serialization/Deserialization
>    Affects Versions: 1.2RC3
>         Environment: every environment
>            Reporter: Daniel David Schäfer
>              Labels: multiref-insanity
>
> Hi all,
> I found a strange behaviour of axis when it serializes nillable bean-members 
> declared as xsd:int.
> I think, it is absolutely overkill to encode a single integer to a chunk like 
> this:
> <multiRef 
>       id="id5"
>       soapenc:root="0" 
>       soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
>       xsi:type="xsd:int"
>       
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>1111054002</multiRef>
> I found a routine called isPrimitive() that decides if a given object should 
> be serialized as an 
> object-reference (multiRef at the end of the soap-body) or directly into the 
> data-structure where
> it is located. This routine calls obj.getClass().isPrimitive() which is 
> unfortunately never true
> with any java-object but only with class-objects like Integer.TYPE (which is 
> the type of int and not
> of java.lang.Integer). 
> So I provided a little patch that returns true for isPrimitive if the given 
> object is of a subtype
> of java.lang.Number (like Integer, Float, etc.).
> bye
> Daniel
> ===================================================================
> RCS file: 
> /usr/local/cvsroot/dev_projects/axis12/src/org/apache/axis/encoding/SerializationContext.java,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- 
> dev_projects/axis12/src/org/apache/axis/encoding/SerializationContext.java    
>     2005/03/17 13:01:38     1.1
> +++ 
> dev_projects/axis12/src/org/apache/axis/encoding/SerializationContext.java    
>     2005/03/17 13:03:05     1.2
> @@ -606,9 +606,13 @@
>      public boolean isPrimitive(Object value)
>      {
>          if (value == null) return true;
> -
> +             
> +             if(value instanceof java.lang.Number) {
> +                     return true;
> +             }
> +             
>          Class javaType = value.getClass();
> -
> +             
>          if (javaType.isPrimitive()) return true;
>  
>          if (javaType == String.class) return true;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to