You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Alexey Bezrodnov <ab...@latista.com> on 2006/07/14 12:07:47 UTC

[PATCH]

Bug in current version (07/14/2006).

class - org.apache.xmlrpc.server.ReflectiveXmlRpcHandler

bug in the method :

	public Object execute(XmlRpcRequest pRequest) throws XmlRpcException
{
	    AuthenticationHandler authHandler =
mapping.getAuthenticationHandler();
	    if (authHandler != null  &&
!authHandler.isAuthorized(pRequest)) {
	        throw new XmlRpcNotAuthorizedException("Not authorized");
	    }
	    Object[] args = new Object[pRequest.getParameterCount()];
	    for (int j = 0;  j < args.length;  j++) {
	        args[j] = pRequest.getParameter(j);
	    }
	    Object instance = getInstance(pRequest);
	    for (int i = 0;  i < methods.length;  i++) {
            MethodData methodData = methods[i];
            TypeConverter[] converters = methodData.typeConverters;
            if (args.length == converters.length) {
                boolean matching = true;
                for (int j = 0;  j < args.length;  j++) {
// As is:
//                    if (!converters[j].isConvertable(args[i])) {
// As should be:
                    if (!converters[j].isConvertable(args[j])) {
                        matching = false;
                        break;
                    }
                }
                if (matching) {
                    for (int j = 0;  j < args.length;  j++) {
                        args[i] = converters[i].convert(args[i]);
                    }
                    return invoke(instance, methodData.method, args);
                }
            }
	    }
	    throw new XmlRpcException("No method matching arguments: " +
Util.getSignature(args));
    }



Hope it helps ...

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org