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 "Jeff Saremi (JIRA)" <ax...@ws.apache.org> on 2005/04/27 16:35:36 UTC

[jira] Created: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

1.2Rc3: Changes to body or header do not get serialized
-------------------------------------------------------

         Key: AXIS-1960
         URL: http://issues.apache.org/jira/browse/AXIS-1960
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.2RC3    
 Environment: JDK1.4.2_07
Axis version 1.2Rc3
Tomcat 5.0, Eclipse 3.0
    Reporter: Jeff Saremi


You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
You can see the changes using XMLUtils.xxxToString() methods.
Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.

Example:

org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
Node myNode = body.getElementsByTagName("MyNodeName").item(0);
myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
// you can see the added text node in the followin output
System.out.println(XMLUtils.ElementToString(body));
// however, you will not see it in this one
// therefore your changes are not avaialable to the next handler or service
SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
serContext.setSendDecl(true);
serContext.setEncoding("UTF-8");
body.output(serContext);

-- 
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


[jira] Commented: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Steve Green (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-1960?page=comments#action_12317796 ] 

Steve Green commented on AXIS-1960:
-----------------------------------

Venkat,

Saw this in CVS:
        Fix for AXIS-1960:
        - Added a new test case for TestSOAPBody.java to test for this bug.
        - added a call to setDirty(true) inside a few methods in NodeImpl
        - added setDirty(false) in getAsString() to fix ant all-tests errors.

Calling setDirty(false) in MessageElement causes the rerverse problem as the one you are fixing here.  Consider the following events.

    1.  MessageElement with sax reply has children added.
    2.  Element is marked dirty (as it should be).
    3.  Someone downstream calls getAsString(), perhaps for debugging or perhaps via getAsDOM().
    4.  Element is marked clean, and the new nodes are never serialized.

So I see 2 problems, and they apply to getAsDOM(), and getAsDocument() as well.

    1.  The value returned from getAsXXXX() is wrong.
    2.  Calling getAsXXXX() is destructive.  To borrow a C++ idium, I would hope that getAsXXXX() is "const".  Furthermore, I hope the answer to my concerns isn't "setDirty(oldDirty)".

My suspsicion is that if the unit tests are failing, something else is wrong.  Setting dirty to false feels like masking of symptoms.  I have a test program which demonstrates my concerns.  Please let me know if you'd like me to upload it.


> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi
>     Assignee: Venkat Reddy

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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


[jira] Resolved: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1960?page=all ]
     
Venkat Reddy resolved AXIS-1960:
--------------------------------

    Resolution: Fixed

> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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


[jira] Commented: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1960?page=comments#action_66058 ]
     
Venkat Reddy commented on AXIS-1960:
------------------------------------

Applied a patch for SOAPPart.java. Try running your code again. And remmeber to call SOAPMessage.saveChanges(). My previous comment says SOAPEnvelope instead of SOAPMessage. It was typo.

-Venkat



> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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


[jira] Resolved: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1960?page=all ]
     
Venkat Reddy resolved AXIS-1960:
--------------------------------

    Resolution: Fixed

Fixed.

> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi
>     Assignee: Venkat Reddy

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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


[jira] Commented: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-1960?page=comments#action_12313155 ] 

Davanum Srinivas commented on AXIS-1960:
----------------------------------------

venkat,

please increase the priority on this one.

thanks,
dims

> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi
>     Assignee: Venkat Reddy

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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


[jira] Commented: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1960?page=comments#action_65951 ]
     
Venkat Reddy commented on AXIS-1960:
------------------------------------

Try calling SOAPEnvelope.saveChanges() after making changes to SOAPBody.

- Venkat

> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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


[jira] Reopened: (AXIS-1960) 1.2Rc3: Changes to body or header do not get serialized

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1960?page=all ]
     
Venkat Reddy reopened AXIS-1960:
--------------------------------

     Assign To: Venkat Reddy

The earlier fix (setting dirty flag in NodeImpl.appendChild) was causing failures in ant all-tests.

> 1.2Rc3: Changes to body or header do not get serialized
> -------------------------------------------------------
>
>          Key: AXIS-1960
>          URL: http://issues.apache.org/jira/browse/AXIS-1960
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: JDK1.4.2_07
> Axis version 1.2Rc3
> Tomcat 5.0, Eclipse 3.0
>     Reporter: Jeff Saremi
>     Assignee: Venkat Reddy

>
> You can add a node or change the value of a node in body or header of a message but the SerializationContext does not output these changes.
> You can see the changes using XMLUtils.xxxToString() methods.
> Having called saveChanges(), setEnvelope(), setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, ...) have no effect on this at all.
> Example:
> org.apache.axis.message.SOAPBody body = (org.apache.axis.message.SOAPBody)env.getBody();
> Node myNode = body.getElementsByTagName("MyNodeName").item(0);
> myNode.appendChild(body.getOwnerDocument().createTextNode("SomeNewText"));
> // you can see the added text node in the followin output
> System.out.println(XMLUtils.ElementToString(body));
> // however, you will not see it in this one
> // therefore your changes are not avaialable to the next handler or service
> SerializationContext serContext = new SerializationContext(new PrintWriter(System.out), message.getMessageContext());
> serContext.setSendDecl(true);
> serContext.setEncoding("UTF-8");
> body.output(serContext);

-- 
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