This call is very similar to the zimki.publishService call, but instead of a list of named arguments, this just receives a dictionary with all the arguments in. Therefore, methods published this way must be declared to expect exactly one argument; the argument dictionary.
function myMethod(args) {
return {
text: "Hello, " + args.foo,
number: args.bar
};
}
zimki.publishAPI(
'my.method.name',
myMethod,
'<baz><text>Text goes here</text><number>10</number></baz>',
{ foo: {optional:0}, bar: { optional:1 } }
);
Parent
zimki
|