ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r631687 - in /webservices/commons/trunk/modules/axiom/modules: axiom-api/src/main/java/org/apache/axiom/om/impl/builder/ axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/ axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/ axi...
Date Wed, 27 Feb 2008 19:33:16 GMT
Author: scheu
Date: Wed Feb 27 11:33:14 2008
New Revision: 631687

URL: http://svn.apache.org/viewvc?rev=631687&view=rev
Log:
WSCOMMONS-303
Contributor: Rich Scheuerle
Fix for NPE and SOAPFaultException revealed by Axis2 Continuum

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java?rev=631687&r1=631686&r2=631687&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
Wed Feb 27 11:33:14 2008
@@ -532,4 +532,8 @@
             throw new OMException(e);
         }
     }
+    
+    public boolean isLookahead() {
+        return lookAheadToken >= 0;
+    }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java?rev=631687&r1=631686&r2=631687&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
Wed Feb 27 11:33:14 2008
@@ -202,6 +202,7 @@
      * @throws OMException
      */
     protected OMNode createOMElement() throws OMException {
+        
         OMElement node;
         String elementName = parser.getLocalName();
         if (lastNode == null) {
@@ -354,7 +355,6 @@
         } else if ((elementLevel == 3) &&
                 parent.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME) &&
                 elementName.equals(SOAPConstants.BODY_FAULT_LOCAL_NAME)) {
-
             // this is a headerblock
             element = soapFactory.createSOAPFault((SOAPBody) parent, this);
             processNamespaceData(element, false);
@@ -373,7 +373,6 @@
         } else if (elementLevel > 3 && processingFault) {
             element = builderHelper.handleEvent(parser, parent, elementLevel);
         } else {
-
             // this is neither of above. Just create an element
             element = soapFactory.createOMElement(elementName, null,
                                                   parent, this);

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=631687&r1=631686&r2=631687&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Wed Feb 27 11:33:14 2008
@@ -713,6 +713,11 @@
      * @return Returns reader.
      */
     private XMLStreamReader getXMLStreamReader(boolean cache) {
+        if (builder != null && this.builder instanceof StAXOMBuilder) {
+            if (((StAXOMBuilder) builder).isLookahead()) {
+                this.buildNext();
+            }
+        }
         // The om tree was built by hand and is already complete
         if ((builder == null) && done) {
             return new OMStAXWrapper(null, this, false);

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java?rev=631687&r1=631686&r2=631687&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java
Wed Feb 27 11:33:14 2008
@@ -191,7 +191,9 @@
             lookAheadSuccessful = soapBuilder.lookahead();
             if (lookAheadSuccessful) {
                 this.lookAheadLocalName = soapBuilder.getName();
-                this.lookAheadNS = factory.createOMNamespace(soapBuilder.getNamespace(),

+                String ns = soapBuilder.getNamespace();
+                ns = (ns == null) ? "" : ns;
+                this.lookAheadNS = factory.createOMNamespace(ns, 
                                                              soapBuilder.getPrefix());
             }
         }



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


Mime
View raw message