You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2008/07/02 02:03:23 UTC

svn commit: r673239 - /ode/trunk/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java

Author: midon
Date: Tue Jul  1 17:03:22 2008
New Revision: 673239

URL: http://svn.apache.org/viewvc?rev=673239&view=rev
Log:
handle 500's with unknown xml docs

Modified:
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java?rev=673239&r1=673238&r2=673239&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java Tue Jul  1 17:03:22 2008
@@ -287,7 +287,7 @@
             Operation opDef = odeMex.getOperation();
             BindingOperation opBinding = portBinding.getBindingOperation(opDef.getName(), opDef.getInput().getName(), opDef.getOutput().getName());
             if (opDef.getFaults().isEmpty()) {
-                errmsg = "Operation has no fault. This 500 error will be considered as a failure.";
+                errmsg = "Operation " + opDef.getName() + " has no fault. This 500 error will be considered as a failure.";
                 if (log.isDebugEnabled()) log.debug(errmsg);
                 odeMex.replyWithFailure(MessageExchange.FailureType.OTHER, errmsg, HttpClientHelper.prepareDetailsElement(method));
             } else if (opBinding.getBindingFaults().isEmpty()) {
@@ -305,8 +305,12 @@
                     QName bodyName = new QName(bodyEl.getNamespaceURI(), bodyEl.getNodeName());
                     Fault faultDef = WsdlUtils.inferFault(opDef, bodyName);
 
-                    // is this fault bound with ODE extension?
-                    if (!WsdlUtils.isOdeFault(opBinding.getBindingFault(faultDef.getName()))) {
+                    if (faultDef == null) {
+                        errmsg = "Unknown Fault " + bodyName + " This 500 error will be considered as a failure.";
+                        if (log.isDebugEnabled()) log.debug(errmsg);
+                        odeMex.replyWithFailure(MessageExchange.FailureType.OTHER, errmsg, HttpClientHelper.prepareDetailsElement(method));
+                    } else if (!WsdlUtils.isOdeFault(opBinding.getBindingFault(faultDef.getName()))) {
+                        // is this fault bound with ODE extension?
                         errmsg = "Fault " + bodyName + " is not bound with " + new QName(Namespaces.ODE_HTTP_EXTENSION_NS, "fault") + ". This 500 error will be considered as a failure.";
                         if (log.isDebugEnabled()) log.debug(errmsg);
                         odeMex.replyWithFailure(MessageExchange.FailureType.OTHER, errmsg, HttpClientHelper.prepareDetailsElement(method));
@@ -391,7 +395,7 @@
 
                     // handle headers
                     httpMethodConverter.extractHttpResponseHeaders(odeResponse, method, outputMessage, opBinding.getBindingOutput());
-                    
+
                     try {
                         if (log.isInfoEnabled())
                             log.info("Response:\n" + DOMUtils.domToString(odeResponse.getMessage()));