[
http://issues.apache.org/jira/browse/AXIS-1469?page=comments#action_62549 ]
Guillaume Sauthier commented on AXIS-1469:
------------------------------------------
Well
For now, only JAX-RPC Handlers can handle this situation without manual
intervention.
This is the code you must write at hand to prevent the form change :
-- Before your code :
// force the current form to SOAPEnvelope
message.getSOAPPart().getEnvelope();
MessageContext mc = ... // get the current MEssageContext
mc.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
Boolean.FALSE);
-- your code goes here
...
-- After your code
mc.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
Boolean.TRUE);
// persists the changes
message.saveChange();
Notice that you need a MessageContext to store the ALLOW_FORM_OPTIMIZATION
value...
> Updates not effective after saveChanges() or writeTo()
> ------------------------------------------------------
>
> Key: AXIS-1469
> URL: http://issues.apache.org/jira/browse/AXIS-1469
> Project: Axis
> Type: Bug
> Components: SAAJ
> Versions: 1.2 Beta
> Environment: JDK 1.4.2, Resin 2.1.14
> Reporter: Mattias Jiderhamn
> Priority: Critical
>
> Not sure how to explain this in an understandable manner, but run this code
> and you will clearly see the problem:
> SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
> SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope(); // Get
> handle to envelope
> // soapMessage.writeTo(System.out); // This would give the same results
> soapMessage.saveChanges(); // This converts the SOAP message to String form
> (as a Fix for Bug 16418???)
> soapEnvelope.addChildElement("foo", "bar", "http://foo/bar"); // Add child
> elements
> soapMessage.writeTo(System.out); // The message is already in String form,
> and changes have no effect
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira