Author: jleroux
Date: Tue Mar 1 18:03:14 2011
New Revision: 1075952
URL:
http://svn.apache.org/viewvc?rev=1075952&view=revLog:
A fix suggested by Michael Reichenbach at "Multiple responses send by SOAPEventHandler when ServiceValidationException occurs"
https://issues.apache.org/jira/browse/OFBIZ-4207Problem
=======
When calling a service that was defined as "export=true" and a non-optional parameter is missing, then the SOAP-Response is not a valid XML.
Cause
=====
The cause is, that in SOAPEventHandler.invoke() the dispatcher.runSync() throws a ServiceValidationException ("The following required parameter is missing..."). This will be catched by the GenericServiceException-block, a error response will be written to the output stream (via sendError()) and an EventHandlerException will be thrown. This exception will again be catched (this time by the Exception-block and another error response will be written to the output stream.
Solution
========
I think the best solution is simply not to call sendError in the GenericServiceException-block.
JLR: I simply commented out the faulty line (with a reference to OFBIZ-4207) in case someone would want to improve the error message.
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=1075952&r1=1075951&r2=1075952&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java Tue Mar 1 18:03:14 2011
@@ -221,7 +221,7 @@ public class SOAPEventHandler implements
}
} catch (GenericServiceException e) {
- sendError(response, "Problem processing the service");
+ //sendError(response, "Problem processing the service"); this causes a not a valid XML response. See
https://issues.apache.org/jira/browse/OFBIZ-4207 throw new EventHandlerException(e.getMessage(), e);
}
}