trying with

bigbaykiter - January 15, 2008 - 21:54
Project:SWX
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:bigbaykiter
Status:active
Description

I keep getting the following error back in flash :
'Warning: Unknown argument in SWX.call. methodArgs is not a valid argument.'

and this as a result :
Missing required arguments

check my code below, any direction would be much appreciated :

import org.swxformat.SWX;

var swx:SWX = new SWX();
swx.gateway = "http://urbian.co.za/d5/?q=services/swx"
swx.encoding = "GET";
swx.debug = true;


var callParameters:Object =
{
    serviceClass: "Drupal",
   method: "callService",
args: "['node.load']",
methodArgs:  "[1,['title']]",
    result: [this, resultHandler],
timeout: [this, timeoutHandler],
fault: [this, faultHandler]
}

swx.call(callParameters);

#1

tomsun - January 16, 2008 - 21:10

Sorry, the original commit was incompatible with the SWX actionscript library, although it worked fine with the loadMove() approach as described in the original version of README.txt.

I changed the way arguments are passed to solve this problem; make sure you get rev 1.2 or later of swx/server/php/services/Drupal.php when trying the below approach (http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/swx/server/...)

import org.swxformat.SWX;

var swx:SWX = new SWX();
swx.gateway = "http://yoursite.com?q=services/swx"
swx.encoding = "GET";
swx.debug = true;

var callParameters:Object = {
    serviceClass: "Drupal",
    method: "callService",
    args: ['node.load', [1,['title']]],
    result: [this, resultHandler],
    timeout: [this, timeoutHandler],
    fault: [this, faultHandler]
}

swx.call(callParameters);

I.e. the first element in callParameter.args is the drupal service name and the second element is the parameters to that service.

 
 

Drupal is a registered trademark of Dries Buytaert.