Author: doogie
Date: Sat Oct 20 20:11:39 2007 New Revision: 586839 URL: http://svn.apache.org/viewvc?rev=586839&view=rev Log: The internal serviceInvoker methods were returning map in all cases. So, change the return type to match. Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java?rev=586839&r1=586838&r2=586839&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java Sat Oct 20 20:11:39 2007 @@ -55,15 +55,11 @@ * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { - Object result = serviceInvoker(localName, modelService, context); - - if (result == null || !(result instanceof Map)) - throw new GenericServiceException("Service did not return expected result"); - return (Map) result; + return serviceInvoker(localName, modelService, context); } // Invoke the BeanShell Script. - private Object serviceInvoker(String localName, ModelService modelService, Map context) throws GenericServiceException { + private Map serviceInvoker(String localName, ModelService modelService, Map context) throws GenericServiceException { if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=586839&r1=586838&r2=586839&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java Sat Oct 20 20:11:39 2007 @@ -67,21 +67,15 @@ * @see org.ofbiz.service.engine.GenericEngine#runSync(java.lang.String, org.ofbiz.service.ModelService, java.util.Map) */ public Map runSync(String localName, ModelService modelService, Map context) throws GenericServiceException { - Object result = serviceInvoker(modelService, context); + Map result = serviceInvoker(modelService, context); if (result == null) throw new GenericServiceException("Service did not return expected result"); - if (!(result instanceof Map)) { - Map newResult = FastMap.newInstance(); - - newResult.put("result", result); - return newResult; - } - return (Map) result; + return result; } // Invoke the remote SOAP service - private Object serviceInvoker(ModelService modelService, Map context) throws GenericServiceException { + private Map serviceInvoker(ModelService modelService, Map context) throws GenericServiceException { if (modelService.location == null || modelService.invoke == null) throw new GenericServiceException("Cannot locate service to invoke"); |
Free forum by Nabble | Edit this page |