axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Blue <>
Subject Unable to update a string element within a message with 1.1 rc2.
Date Wed, 02 Apr 2003 10:31:30 GMT

We are now using axis 1.1 rc2, and we have built a request hander, in which
we are trying to alter the request message before it arrives at the soap
binding class. In the handler we perform the following steps:

first we get the request message from the message context with:
Message message = msgContext.getRequestMessage();

next we get the soap body with
MessageElement body = message.getSOAPEnvelope().getBody();

having for the body, we navigate through the object with getChidElements(),
untill we find the elemnt the we want to update.
As we want to update the text within the element, and there is no way do do
this we can find in the API, we create a new MessageElement
MessageElement newElement = new MessageElement(element.getQName(), "new
string value");

Then we remove the original element
MessageElement parent = element.getParentElement();

Then we add our new element

Also, when we print out the parent with:
the ouput still contains the original element text

however when we list the child elements parent, it has the new element with
the new text value.

Please can anyone shed some light on this

Neil Blue

View raw message