You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2014/06/10 18:56:06 UTC

svn commit: r1601687 - in /webservices/axiom/trunk: devguide/src/docbkx/ modules/axiom-api/src/main/java/org/apache/axiom/soap/ modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/ modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/d...

Author: veithen
Date: Tue Jun 10 16:56:05 2014
New Revision: 1601687

URL: http://svn.apache.org/r1601687
Log:
AXIOM-430:
* Don't skip serialization of empty SOAP Header elements.
* Add a createDefaultSOAPMessage method to SOAPFactory.

Added:
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateDefaultSOAPMessage.java   (with props)
Modified:
    webservices/axiom/trunk/devguide/src/docbkx/devguide.xml
    webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFactoryImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java
    webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java
    webservices/axiom/trunk/userguide/src/docbkx/userguide.xml

Modified: webservices/axiom/trunk/devguide/src/docbkx/devguide.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/devguide/src/docbkx/devguide.xml?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/devguide/src/docbkx/devguide.xml (original)
+++ webservices/axiom/trunk/devguide/src/docbkx/devguide.xml Tue Jun 10 16:56:05 2014
@@ -172,6 +172,30 @@ javax.xml.stream.XMLOutputFactory=com.be
     <chapter>
         <title>Design</title>
         <section>
+            <title>General design principles and goals</title>
+            <formalpara>
+                <title>Consistent serialization</title>
+                <para>
+                    Axiom supports multiple methods and APIs to serialize an object model to XML or to transform it
+                    to another (non Axiom) representation. This includes serialization to byte or character streams, transformation
+                    to StAX in push mode (i.e. writing to an <classname>XMLStreamWriter</classname>) or pull mode
+                    (i.e. reading from an <classname>XMLStreamReader</classname>), as well as transformation to SAX.
+                    The representations produced by these different methods should be consistent with each other.
+                    If a given use case can be implemented using more than one of these methods, then the end result
+                    should be the same, whichever method is chosen.
+                </para>
+            </formalpara>
+            <para>
+                <link xlink:href="https://issues.apache.org/jira/browse/AXIOM-430">AXIOM-430</link> provides an example
+                where this principle was not respected.
+            </para>
+            <para>
+                It should be noted that this principle can obviously only be respected within the limits imposed
+                by a given API. E.g. if a given API has limited support for DTDs, then a <tag class="element">DOCTYPE</tag>
+                declaration may be skipped when that API is used.
+            </para>
+        </section>
+        <section>
             <title>OSGi integration and separation between API and implementation</title>
             <section>
                 <title>Introduction</title>

Modified: webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java (original)
+++ webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/soap/SOAPFactory.java Tue Jun 10 16:56:05 2014
@@ -270,11 +270,27 @@ public interface SOAPFactory extends OMF
      * Create a default SOAP envelope with an empty header and an empty body. Note that the method
      * will not create an associated {@link SOAPMessage} or {@link OMDocument} instance and the
      * parent of the returned {@link SOAPEnvelope} is <code>null</code>.
+     * <p>
+     * <b>Note:</b> This method is typically used in conjunction with
+     * {@link SOAPEnvelope#getHeader()}. In order to avoid generating unnecessary empty SOAP
+     * headers, you should consider using {@link #createDefaultSOAPMessage()} together with
+     * {@link SOAPEnvelope#getOrCreateHeader()} instead. This method may be deprecated and/or
+     * removed in future Axiom versions.
      * 
      * @return the default SOAP envelope
      */
     SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException;
 
+    /**
+     * Create a default SOAP message with an envelope with an empty body.
+     * <p>
+     * Since no SOAP header is added to the envelope, this method should be used in conjunction with
+     * {@link SOAPEnvelope#getOrCreateHeader()} (if SOAP header blocks need to be added).
+     * 
+     * @return the default SOAP envelope
+     */
+    SOAPMessage createDefaultSOAPMessage();
+    
     SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException;
 
     /**

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java (original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java Tue Jun 10 16:56:05 2014
@@ -19,8 +19,6 @@
 
 package org.apache.axiom.soap.impl.dom;
 
-import java.util.Iterator;
-
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMConstants;
 import org.apache.axiom.om.OMElement;
@@ -32,7 +30,6 @@ import org.apache.axiom.om.OMOutputForma
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.common.serializer.push.OutputException;
 import org.apache.axiom.om.impl.common.serializer.push.Serializer;
-import org.apache.axiom.om.impl.dom.NodeImpl;
 import org.apache.axiom.om.impl.dom.ParentNode;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP11Version;
@@ -200,16 +197,7 @@ public class SOAPEnvelopeImpl extends SO
                     xmlVersion == null ? OMConstants.DEFAULT_XML_VERSION
                             : xmlVersion);
         }
-        serializer.serializeStartpart(this);
-        //serialize children
-        for (Iterator it = getChildren(); it.hasNext(); ) {
-        	NodeImpl child = (NodeImpl)it.next();
-        	// Skip empty SOAPHeader (compatibility with previous Axiom versions; see AXIOM-340)
-        	if (!(child instanceof SOAPHeader && ((SOAPHeader)child).getFirstOMChild() == null)) {
-        		child.internalSerialize(serializer, format, cache);
-        	}
-        }
-        serializer.writeEndElement();
+        super.internalSerialize(serializer, format, cache);
         serializer.writeEndDocument();
     }
 

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFactoryImpl.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFactoryImpl.java (original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFactoryImpl.java Tue Jun 10 16:56:05 2014
@@ -47,6 +47,14 @@ public abstract class SOAPFactoryImpl ex
         return new SOAPMessageImpl(builder, this);
     }
 
+    public final SOAPMessage createDefaultSOAPMessage() {
+        SOAPMessage message = createSOAPMessage();
+        SOAPEnvelope env = createSOAPEnvelope();
+        message.addChild(env);
+        createSOAPBody(env);
+        return message;
+    }
+    
     public final SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder) {
         return new SOAPEnvelopeImpl((ParentNode)message, null, builder, this, false);
     }

Modified: webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java Tue Jun 10 16:56:05 2014
@@ -23,16 +23,11 @@ import junit.framework.TestSuite;
 
 import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
 import org.apache.axiom.ts.soap.SOAPTestSuiteBuilder;
-import org.apache.axiom.ts.soap.envelope.TestSerialize;
 
 public class SOAPImplementationTest extends TestCase {
     public static TestSuite suite() {
         SOAPTestSuiteBuilder builder = new SOAPTestSuiteBuilder(new OMDOMMetaFactory(), false, false);
         
-        // TODO: AXIOM-430
-        builder.exclude(org.apache.axiom.ts.soap.envelope.TestSerialize.class, "(&(file=*/empty-header.xml)(|(serializationStrategy=OutputStream)(serializationStrategy=Writer)(serializationStrategy=XMLStreamWriter)(serializationStrategy=SAXSource)))");
-        builder.exclude(org.apache.axiom.ts.soap.message.TestSerialize.class, "(&(file=*/empty-header.xml)(|(serializationStrategy=OutputStream)(serializationStrategy=Writer)(serializationStrategy=XMLStreamWriter)(serializationStrategy=SAXSource)))");
-        
         return builder.build();
     }
 }

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java Tue Jun 10 16:56:05 2014
@@ -19,8 +19,6 @@
 
 package org.apache.axiom.soap.impl.llom;
 
-import java.util.Iterator;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.axiom.om.OMCloneOptions;
@@ -32,7 +30,6 @@ import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.llom.OMNodeImpl;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.om.impl.common.serializer.push.OutputException;
 import org.apache.axiom.om.impl.common.serializer.push.Serializer;
@@ -201,16 +198,7 @@ public class SOAPEnvelopeImpl extends SO
                             : charSetEncoding,
                     xmlVersion == null ? OMConstants.DEFAULT_XML_VERSION : xmlVersion);
         }
-        serializer.serializeStartpart(this);
-        //serialize children
-        for (Iterator it = getChildren(); it.hasNext(); ) {
-        	OMNodeImpl child = (OMNodeImpl)it.next();
-        	// Skip empty SOAPHeader (compatibility with previous Axiom versions; see AXIOM-340)
-        	if (!(child instanceof SOAPHeader && ((SOAPHeader)child).getFirstOMChild() == null)) {
-        		child.internalSerialize(serializer, format, cache);
-        	}
-        }
-        serializer.writeEndElement();
+        super.internalSerialize(serializer, format, cache);
         serializer.writeEndDocument();
         if (!cache) {
             // let's try to close the builder/parser here since we are now done with the

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java (original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPFactoryImpl.java Tue Jun 10 16:56:05 2014
@@ -51,6 +51,14 @@ public abstract class SOAPFactoryImpl ex
         }
     }
 
+    public final SOAPMessage createDefaultSOAPMessage() {
+        SOAPMessage message = createSOAPMessage();
+        SOAPEnvelope env = createSOAPEnvelope();
+        message.addChild(env);
+        createSOAPBody(env);
+        return message;
+    }
+    
     public final SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder) {
         return new SOAPEnvelopeImpl(message, builder, this);
     }

Modified: webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java (original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java Tue Jun 10 16:56:05 2014
@@ -28,10 +28,6 @@ public class SOAPImplementationTest exte
     public static TestSuite suite() {
         SOAPTestSuiteBuilder builder = new SOAPTestSuiteBuilder(new OMLinkedListMetaFactory(), true, true);
         
-        // TODO: AXIOM-430
-        builder.exclude(org.apache.axiom.ts.soap.envelope.TestSerialize.class, "(&(file=*/empty-header.xml)(|(serializationStrategy=OutputStream)(serializationStrategy=Writer)(serializationStrategy=XMLStreamWriter)(serializationStrategy=SAXSource)))");
-        builder.exclude(org.apache.axiom.ts.soap.message.TestSerialize.class, "(&(file=*/empty-header.xml)(|(serializationStrategy=OutputStream)(serializationStrategy=Writer)(serializationStrategy=XMLStreamWriter)(serializationStrategy=SAXSource)))");
-        
         return builder.build();
     }
 }

Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Tue Jun 10 16:56:05 2014
@@ -169,6 +169,7 @@ public class SOAPTestSuiteBuilder extend
         if (supportsOMSourcedElement) {
             addTest(new org.apache.axiom.ts.soap.envelope.TestSerializeAndConsumeWithOMSEInBody(metaFactory, spec));
         }
+        addTest(new org.apache.axiom.ts.soap.factory.TestCreateDefaultSOAPMessage(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPEnvelopeWithCustomPrefix(metaFactory, spec));
         for (int i=0; i<soapElementTypes.length; i++) {
             addTest(new org.apache.axiom.ts.soap.factory.TestCreateSOAPElement(metaFactory, spec, soapElementTypes[i]));

Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java (original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java Tue Jun 10 16:56:05 2014
@@ -52,7 +52,7 @@ public class TestGetSOAPBodyFirstElement
         // Prepare the message. Note that we do this programmatically to make sure that the message
         // doesn't contain any unwanted whitespace.
         SOAPFactory factory = spec.getFactory(metaFactory);
-        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
+        SOAPEnvelope orgEnvelope = factory.createDefaultSOAPMessage().getSOAPEnvelope();
         orgEnvelope.getBody().addChild(soapFactory.createOMElement(qname.getLocalPart(), qname.getNamespaceURI(), qname.getPrefix()));
         String message = orgEnvelope.toString();
         

Added: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateDefaultSOAPMessage.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateDefaultSOAPMessage.java?rev=1601687&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateDefaultSOAPMessage.java (added)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateDefaultSOAPMessage.java Tue Jun 10 16:56:05 2014
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.ts.soap.factory;
+
+import java.util.Iterator;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPMessage;
+import org.apache.axiom.ts.soap.SOAPSpec;
+import org.apache.axiom.ts.soap.SOAPTestCase;
+
+/**
+ * Checks the content of the SOAP envelope returned by {@link SOAPFactory#createDefaultEnvelope()}.
+ */
+public class TestCreateDefaultSOAPMessage extends SOAPTestCase {
+    public TestCreateDefaultSOAPMessage(OMMetaFactory metaFactory, SOAPSpec spec) {
+        super(metaFactory, spec);
+    }
+
+    protected void runTest() throws Throwable {
+        SOAPMessage message = soapFactory.createDefaultSOAPMessage();
+        SOAPEnvelope env = message.getSOAPEnvelope();
+        assertNotNull(env);
+        assertSame(env, message.getFirstOMChild());
+        assertNull(env.getNextOMSibling());
+        
+        // Check correct SOAP version
+        assertEquals(spec.getEnvelopeNamespaceURI(), env.getNamespaceURI());
+        
+        // Check the children
+        Iterator it = env.getChildren();
+        assertTrue(it.hasNext());
+        OMNode child = (OMNode)it.next();
+        assertTrue(child instanceof SOAPBody);
+        assertNull(((SOAPBody)child).getFirstOMChild());
+        assertFalse(it.hasNext());
+    }
+}

Propchange: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/factory/TestCreateDefaultSOAPMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/userguide/src/docbkx/userguide.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/userguide/src/docbkx/userguide.xml?rev=1601687&r1=1601686&r2=1601687&view=diff
==============================================================================
--- webservices/axiom/trunk/userguide/src/docbkx/userguide.xml (original)
+++ webservices/axiom/trunk/userguide/src/docbkx/userguide.xml Tue Jun 10 16:56:05 2014
@@ -1487,6 +1487,28 @@ while (iterator.hasNext()) {
                         transitive dependency, you need to update your build.
                     </para>
                 </section>
+                <section>
+                    <title>Serialization changes</title>
+                    <para>
+                        In previous Axiom versions, the <methodname>serialize</methodname> and <methodname>serializeAndConsume</methodname>
+                        methods skipped empty SOAP <tag class="element">Header</tag> elements. On the other hand, such elements would still
+                        appear in the representations produced by <methodname>getXMLStreamReader</methodname> and
+                        <methodname>getSAXSource</methodname>.
+                        For consistency, starting with Axiom 1.2.15, SOAP <tag class="element">Header</tag> elements are always serialized.
+                        This may change the output of existing code, especially code that uses the <methodname>getDefaultEnvelope()</methodname>
+                        defined by <classname>SOAPFactory</classname>.
+                        However, it is expected that this will not break anything because empty SOAP <tag class="element">Header</tag> elements
+                        should be ignored by the receiver.
+                    </para>
+                    <para>
+                        To avoid producing empty <tag class="element">Header</tag> elements, projects should switch from using
+                        <methodname>getDefaultEnvelope()</methodname> and <methodname>getHeader()</methodname> (in <classname>SOAPEnvelope</classname>)
+                        to using <methodname>createDefaultSOAPMessage()</methodname> and <methodname>getOrCreateHeader()</methodname>.
+                    </para>
+                    <para>
+                        For more information, see <link xlink:href="https://issues.apache.org/jira/browse/AXIOM-430">AXIOM-430</link>.
+                    </para>
+                </section>
             </section>
         </section>
     </chapter>