Fix - without this change, if you try to send a SOAP message, for example,
Fix - without this change, if you try to send a SOAP message, for example,

<?xml version='1.0' encoding='UTF-8'?>
<!-- Ias -->
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns0='http://apache.org/wsdl'>
<env:Body><ns0:helloWorld/></env:Body>
</env:Envelope>

with SAAJ, Axis serializes the message on the wire as below

<!-- Ias -->
<?xml version='1.0' encoding='UTF-8'?>
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns0='http://apache.org/wsdl'>
<env:Body><ns0:helloWorld/></env:Body>
</env:Envelope>

, and this is absolutely wrong. The reason is timing of writing XML declaration.
If a comment is before the first element, XML declaration is written behind the comment because SerializationContextImpl handles elements and XML declaration simultaneously.


git-svn-id: 8699849808240b02471d01f5aaa03ec0c1cb68ee@258030 13f79535-47bb-0310-9956-ffa450edef68

apache/axis1-java,apache/axis1-java,apache/axis1-java,apache/axis1-java