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 ch...@apache.org on 2006/03/02 06:01:01 UTC

svn commit: r382297 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java

Author: chinthaka
Date: Wed Mar  1 21:01:00 2006
New Revision: 382297

URL: http://svn.apache.org/viewcvs?rev=382297&view=rev
Log:
Fixing hardcoded SOAP prefix in faults.

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=382297&r1=382296&r2=382297&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java Wed Mar  1 21:01:00 2006
@@ -34,6 +34,7 @@
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.soap.SOAP11Constants;
 import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.ws.commons.soap.SOAPConstants;
 import org.apache.ws.commons.soap.SOAPEnvelope;
 import org.apache.ws.commons.soap.SOAPFault;
 import org.apache.ws.commons.soap.SOAPFaultCode;
@@ -94,19 +95,24 @@
 
             String role = hb.getRole();
 
+            String prefix = se.getNamespace().getPrefix();
+            
             if (!msgContext.isSOAP11()) {
 
                 // if must understand and soap 1.2 the Role should be NEXT , if it is null we considerr
                 // it to be NEXT
+                if (prefix == null || "".equals(prefix)) {
+                    prefix = SOAPConstants.SOAPFAULT_NAMESPACE_PREFIX;
+                }
                 if (role != null) {
                     if (!SOAP12Constants.SOAP_ROLE_NEXT.equals(role)) {
                         throw new AxisFault("Must Understand check failed",
-                                SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND);
+                                prefix + ":" + SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND);
                     }
                 } else {
                     // This is the ultimate receiver, throw an error.
                     throw new AxisFault("Must Understand check failed",
-                            SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND);
+                            prefix + ":" + SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND);
                 }
             } else {
 
@@ -114,7 +120,7 @@
                 // it to be NEXT
                 if ((role != null) && !SOAP11Constants.SOAP_ACTOR_NEXT.equals(role)) {
                     throw new AxisFault("Must Understand check failed",
-                            SOAP11Constants.FAULT_CODE_MUST_UNDERSTAND);
+                            prefix + ":" + SOAP11Constants.FAULT_CODE_MUST_UNDERSTAND);
                 }
             }
         }