axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matti Aarnio (JIRA)" <>
Subject [jira] [Commented] (AXIS-2754) SOAPEnvelope addHeader modifies message body/removes whitespace
Date Sat, 09 Feb 2013 15:25:13 GMT


Matti Aarnio commented on AXIS-2754:

This is because the  addHeader() sets the SOAPEnvelope to be dirty, meaning that possible
high fidelity data is not replayed for <soap-env:Body> output.

The application work-around I have used is to clear the dirty flag after adding headers.

I am assuming this is in a protocol case where a server in question is relaying a request
(response) to external service (host), and where modification of the <soap-env:Header>
contained elements is required as a part of the protocol.

Dropping the dirty-setting from addHeader() may be generally usable, but I think that it is
safer to let the application code knowing the protocol details to choose when to explicitly
clear the dirty flag after constructing the new SOAPEnvelope for outgoing request (response.)

Documenting this as desirable usage pattern would be nice, though.
> SOAPEnvelope addHeader modifies message body/removes whitespace
> ---------------------------------------------------------------
>                 Key: AXIS-2754
>                 URL:
>             Project: Axis
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: 1.4
>         Environment: java 1.4.2
>            Reporter: Gil Bates
>            Priority: Critical
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> Code:
> Message msg=...;
> org.w3c.dom.Element element = ...;
> ....
>  msg.getMessage().getSOAPEnvelope().addHeader(new SOAPHeaderElement(element));
> effect:
> some whitespace information is removed from the message body although only the header
should be affected from above lines
> assuming the original message is
> <?xml version="1.0" encoding="UTF-8"?><soap-env:Envelope xmlns:soap-env=""
xmlns:xsi="" xmlns:xsd="">
>   <soap-env:Body>
>     <GetWeather xmlns="http://www.webserviceX.NET">
>       <CityName>Hamburg</CityName>
>       <CountryName>Germany</CountryName>
>     </GetWeather>
>   </soap-env:Body>
> </soap-env:Envelope>
> Result is
> ...</soap-env:Header><soap-env:Body id="Body"><GetWeather xmlns="http://www.webserviceX.NET">
>       <CityName>Hamburg</CityName>
>       <CountryName>Germany</CountryName>
>     </GetWeather></soap-env:Body></soap-env:Envelope>
> That means, digital signatures etc. can become void.
> This makes Aixs unusable for signatures etc.
> Or, is there a simple way to avoid this?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message