I'm trying to implement a simple XMLRPC test app. Very basic stuff.

The controller looks like this:

    from gluon.tools import Service
    service = Service(globals())

    def index():
        return dict()

    def call():
        return service()

    @service.xmlrpc
    def rpctest(a, b):
        return {'result': a + b}

Here's the JavaScript that does it:

    var CONFIG = {};
    CONFIG.serviceURL = '/mootest/default/call';

    function rpcCall(method, params, callback){
        return new XMLRPC.call({
            url: CONFIG.serviceURL,
            addEmptyParams: false,
            onSuccess: function(response){
                callbck(response)
            }
        }).send(method, params, false);
    }

    window.addEvent('domready', function(){
        console.log('ready');
        rpcCall('rpctest', [new Hash({
            'integer': '1',
            'integer': '2'
        })], function(response){
            $('test').set('html', response);
        });
    });

It's mootools[1] + mootools xmlrpc plugin[2].

The request that went out was:

<?xml 
version="1.0"?><methodCall><methodName>rpctest</methodName><params><param><value><struct><member><name>integer</name><value><int>2</int></value></member></struct></value></param></params></methodCall>

The response I got is: 400 BAD REQUEST

Any idea how I could debug this?

[1] http://mootools.net/
[2] http://mootools.net/forge/p/mootools_xmlrpc



-- 
Branko Vukelić

[email protected]
[email protected]

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group

Reply via email to