Author: scheu
Date: Wed Nov 10 14:05:07 2010
New Revision: 1033474

URL: http://svn.apache.org/viewvc?rev=1033474&view=rev
Log:
Quick change to StAXSOAPModelBuilder to avoid excessive calls to getNamespace().

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

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=1033474&r1=1033473&r2=1033474&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 Nov 10 14:05:07 2010
@@ -486,15 +486,18 @@ public class StAXSOAPModelBuilder extend
         super.processNamespaceData(node);
 
         if (isSOAPElement) {
-            if (node.getNamespace() != null &&
-                    !node.getNamespace().getNamespaceURI()
-                            
.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI) &&
-                    !node.getNamespace().getNamespaceURI()
-                            
.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
-                throw new SOAPProcessingException("invalid SOAP namespace URI. 
" +
-                        "Only " + SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI +
-                        " and " + SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI +
-                        " are supported.", SOAP12Constants.FAULT_CODE_SENDER);
+            OMNamespace omNS = node.getNamespace();
+            if (omNS != null) {
+                String uri = omNS.getNamespaceURI();
+                if (uri.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI) ||
+                    uri.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
+                    // okay
+                } else {
+                    throw new SOAPProcessingException("invalid SOAP namespace 
URI. " +
+                            "Only " + 
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI +
+                            " and " + 
SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI +
+                            " are supported.", 
SOAP12Constants.FAULT_CODE_SENDER);
+                }
             }
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to