axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Commented: (AXIS-1589) SerializationContext.serialize(*,*,*,*,Boolean.FALSE) adds types
Date Wed, 20 Oct 2004 19:00:36 GMT
The following comment has been added to this issue:

     Author: toby cabot
    Created: Wed, 20 Oct 2004 11:58 AM
apologies for attaching the same patch three times - i kept getting scary error messages so
i assumed that it wasn't succeeding.  anyway, this patch (axis-no-types-or-nulls-patch.txt)
also fixes the SerializationContext.serialize() sendNull parameter so that it works when using
the call from outside of Axis to serialize Axis-generated classes.  sendNull had the same
bug that sendType had (which I described in an earlier comment on this bug.  The fix is to
make sendNull a member variable and modify classes that call serialize() so that they don't
hard-code the value but rather use the default.

with this patch I can call serialize() and get documents that don't have xsi:type attributes
or elements (with xsi:nil attributes) for null variables.  it passes all-tests.

View this comment:

View the issue:

Here is an overview of the issue:
        Key: AXIS-1589
    Summary: SerializationContext.serialize(*,*,*,*,Boolean.FALSE) adds types
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis

   Reporter: toby cabot

    Created: Tue, 5 Oct 2004 7:37 AM
    Updated: Wed, 20 Oct 2004 11:58 AM
Environment: fedora core 2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
cvs HEAD as of 2004-10-04


I'm working on an application that needs to xml-serialize trees of wsdl2java-generated objects
to an XML document so it can e.g. save them to a file.  I'm using the 1-argument constructor
and the 5-argument SerializationContext.serialize() method but it seems to ignore the Boolean
sendType argument; it adds types to the output whether the value is Boolean.TRUE or Boolean.FALSE.

The problem seems to be that SerializationContext has a flag (sendXSIType) to indicate whether
the types should be sent, but serialize() never sets that variable so when it calls specific
type serializers (e.g. BeanSerializer) and then they call back to StartElement the caller's
argument has been "forgotten" and it adds the type to the output anyway.

So I've added a patch that seems to fix the problem.  It caches the value of sendXSIType,
sets it based on the user's preference, and then sets it back before exiting serialize().
 It seems to pass all-tests and it respects the value of the caller's sendType argument.

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message