You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Anthony Foiani (JIRA)" <ax...@ws.apache.org> on 2005/09/27 23:03:48 UTC
[jira] Commented: (AXIS-1886) Axis serializes xsd:int as multiRef
[ http://issues.apache.org/jira/browse/AXIS-1886?page=comments#action_12330639 ]
Anthony Foiani commented on AXIS-1886:
--------------------------------------
There's at least one more dup of this issue, AXIS-2077; someone might want to link that in and/or mark it as a duplicate.
Also, has this been checked into CVS? Can we expect it in the next release (whether that be 1.2.2 or 1.3)? Thanks!
> Axis serializes xsd:int as multiRef
> -----------------------------------
>
> Key: AXIS-1886
> URL: http://issues.apache.org/jira/browse/AXIS-1886
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.2RC3
> Environment: every environment
> Reporter: Daniel David Schäfer
>
> 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 contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira