I'm trying to write a class which will encapsulate webservice consumption through javascript; there's not a lot on webservices at these fora. It's been a bit difficult, and I'm going forcibly bald.

In this article on Gecko webservice consumption, it's noted that the callback function for the 'listener' object that is used in the creation of the 'proxy' object has (understandably) a convention - methodnameCallback. In this class I take an argument which is the method name, among others:
Code:
function WebService (serviceURL, serviceName, methodName, responseHandler, errorHandler) {...}
When I try to assign that dynamically -inside this constructor-
Code:
var tmpName = methodName + 'Callback',
    listener = {
        onLoad : function (aProxy) {
            proxy = aProxy;
            proxy.setListener(listener);
        },
        onError : errorHandler
    }
    listener[tmpName] : responseHandler;
I get the following error in Firefox 0.9. on that last line. Error: invalid label There are no illegal characters in the passed argument, and there is no reason I can think of that I shouldn't be able to do this.

Has anybody else had any kind of difficulty?