Author: veithen Date: Sun Jan 20 09:38:55 2013 New Revision: 1435807 URL: http://svn.apache.org/viewvc?rev=1435807&view=rev Log: Use the new SOAPEnvelope#getOrCreateHeader() method where appropriate.
Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java?rev=1435807&r1=1435806&r2=1435807&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java Sun Jan 20 09:38:55 2013 @@ -143,10 +143,7 @@ class XMLSpineImpl implements XMLSpine { soapFactory = (SOAPFactory)envelope.getOMFactory(); // Advance past the header - SOAPHeader header = root.getHeader(); - if (header == null) { - header = soapFactory.createSOAPHeader(root); - } + root.getOrCreateHeader(); // Now advance the parser to the body element SOAPBody body = root.getBody(); @@ -507,10 +504,7 @@ class XMLSpineImpl implements XMLSpine { _createOMElementFromBlock(localPart, ns, block, soapFactory, true); OMElement om = this._getChildOMElement(root.getHeader(), namespace, localPart); if (om == null) { - if (root.getHeader() == null) { - soapFactory.createSOAPHeader(root); - } - root.getHeader().addChild(newOM); + root.getOrCreateHeader().addChild(newOM); } else { om.insertSiblingBefore(newOM); om.detach(); @@ -523,10 +517,7 @@ class XMLSpineImpl implements XMLSpine { OMNamespace ns = soapFactory.createOMNamespace(namespace, null); OMElement newOM = _createOMElementFromBlock(localPart, ns, block, soapFactory, true); - if (root.getHeader() == null) { - soapFactory.createSOAPHeader(root); - } - root.getHeader().addChild(newOM); + root.getOrCreateHeader().addChild(newOM); }