You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by nt...@apache.org on 2007/02/14 16:58:03 UTC

svn commit: r507590 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java

Author: nthaker
Date: Wed Feb 14 07:58:02 2007
New Revision: 507590

URL: http://svn.apache.org/viewvc?view=rev&rev=507590
Log:
Axis2-2177

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java?view=diff&rev=507590&r1=507589&r2=507590
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java Wed Feb 14 07:58:02 2007
@@ -25,6 +25,7 @@
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.ws.WebServiceException;
 
+import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
@@ -194,7 +195,7 @@
             SOAPFaultDetail detail = root.getBody().getFault().getDetail();
             for (int i=0; i<numDetailBlocks; i++) {
                 OMElement om = this._getChildOMElement(detail, i);
-                blocks[i] = this._getBlockFromOMElement(om, null, obf);
+                blocks[i] = this._getBlockFromOMElement(om, null, obf, false);
                 
             }
         }
@@ -269,7 +270,7 @@
         if (log.isDebugEnabled()) {
             log.debug("getBodyBlock: Found omElement " + omElement.getQName() );
         }
-        return this._getBlockFromOMElement(omElement, context, blockFactory);
+        return this._getBlockFromOMElement(omElement, context, blockFactory, false);
     }
     
     /* (non-Javadoc)
@@ -298,7 +299,7 @@
         if (log.isDebugEnabled()) {
             log.debug("getBodyBlock: Found omElement " + omElement.getQName() );
         }
-        return this._getBlockFromOMElement(omElement, context, blockFactory);
+        return this._getBlockFromOMElement(omElement, context, blockFactory, true);
     }
 
 	public void setBodyBlock(int index, Block block) throws WebServiceException {
@@ -382,7 +383,7 @@
         if (om == null) {
             return null;
         }
-        return this._getBlockFromOMElement(om, context, blockFactory);
+        return this._getBlockFromOMElement(om, context, blockFactory, false);
 	}
 
 	public void setHeaderBlock(String namespace, String localPart, Block block) throws WebServiceException {
@@ -443,7 +444,7 @@
         }
     }
     
-    private Block _getBlockFromOMElement(OMElement om, Object context, BlockFactory blockFactory) throws WebServiceException {
+    private Block _getBlockFromOMElement(OMElement om, Object context, BlockFactory blockFactory, boolean setComplete) throws WebServiceException {
         try {
             QName qName = om.getQName();
             /* TODO We could gain performance if OMSourcedElement exposed a getDataSource method 
@@ -473,7 +474,24 @@
             // Replace the OMElement with the OMSourcedElement that delegates to the block
             OMElement newOM = _createOMElementFromBlock(qName, block, soapFactory);
             om.insertSiblingBefore(newOM);
-            ((OMElementImpl)om).setComplete(true);
+        
+            // We want to set the om element and its parents to complete to 
+            // shutdown the parsing.  
+            // TODO It would also be nice to close the input XMLStreamReader connected
+            // to the builder.
+            if (setComplete) {
+            	OMNode o = om;
+            	while (o != null && o instanceof OMElementImpl) {
+            		((OMElementImpl)o).setComplete(true);
+            		if (o.getParent() instanceof OMElement) {
+            			o = (OMNode) o.getParent();
+            		} else {
+            			o = null;
+            		}
+            	}
+            }
+            
+  
             om.detach();
             return block;
         } catch (XMLStreamException xse) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org