Author: jaz
Date: Mon Apr 16 10:45:33 2007
New Revision: 529339
URL:
http://svn.apache.org/viewvc?view=rev&rev=529339Log:
XML-RPC handler only returns valid out parameters back; no more internal parameters
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java?view=diff&rev=529339&r1=529338&r2=529339==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/XmlRpcEventHandler.java Mon Apr 16 10:45:33 2007
@@ -180,7 +180,19 @@
}
public Object execute(XmlRpcRequest xmlRpcReq) throws XmlRpcException {
+ DispatchContext dctx = dispatcher.getDispatchContext();
String serviceName = xmlRpcReq.getMethodName();
+ ModelService model = null;
+ try {
+ model = dctx.getModelService(serviceName);
+ } catch (GenericServiceException e) {
+ throw new XmlRpcException(e.getMessage(), e);
+ }
+
+ // check remote invocation security
+ if (model == null || !model.export) {
+ throw new XmlRpcException("Unknown method");
+ }
// prepare the context -- single parameter type struct (map)
Map context = this.getContext(xmlRpcReq, serviceName);
@@ -208,7 +220,8 @@
Debug.logError(ServiceUtil.getErrorMessage(resp), module);
}
- return resp;
+ // return only definied parameters
+ return model.makeValid(resp, ModelService.OUT_PARAM, false, null);
}
protected Map getContext(XmlRpcRequest xmlRpcReq, String serviceName) throws XmlRpcException {