How to initialize a JSON-RPC Service:
//You need the package of course
dojo.require("dojo.rpc.JsonService");
// Create a callback function to handle the results generated
// by a method A second optional parameter to your call back
// will allow the callback to use the submission Id of the
// json-rpc request
function contentCallBack(result) {
dojo.debug("in contentCallBack");
var handlerNode = document.getElementById("content");
handlerNode.innerHTML = result;
}
// Create a new object
var testClass = new dojo.rpc.JsonService("testClass.smd");
None.
Debug Log:
DEBUG: RpcService: Attempting to load SMD document from: testClass.smd
DEBUG: RpcService: Processing returned SMD.
DEBUG: RpcService: Creating Method: this. myecho ()
DEBUG: RpcService: Successfully created myecho ()
DEBUG: RpcService: Creating Method: this. contentB ()
DEBUG: RpcService: Successfully created contentB ()
DEBUG: RpcService: Creating Method: this. contentC ()
DEBUG: RpcService: Successfully created contentC ()
DEBUG: RpcService: Creating Method: this. add ()
DEBUG: RpcService: Successfully created add ()
DEBUG: RpcService: Dojo RpcService is ready for use.