You can reference the original article submitted by John Jardin.

Quick Summary

Remote Services or RPC (Remote Procedure Call) allows you from Client-side JavaScript, to execute RPC functions that can trigger Server-side JavaScript or Java. You can also add a callback to the submission so that once it's complete, you can get a handle a on the result and continue processing your Client-side JavaScript code.

var myObject = myRPC.RPCFunctionName("param1");
myObject.addCallback( function(result) {
	console.log(result);
});
<xe:jsonRpcService
	serviceName="myRPC"
	id="myRPC">
	<xe:this.methods>
		<xe:remoteMethod
			name="RPCFunctionName"
			script="SSJSFunctionName(param1);">
			<xe:this.arguments>
				<xe:remoteMethodArg
					name="param1">
				</xe:remoteMethodArg>
			</xe:this.arguments>
		</xe:remoteMethod>
	</xe:this.methods>
</xe:jsonRpcService>
function SSJSFunctionName(param1){
	var result = param1 + " - Success";
	return result;
}

Detailed Overview

This is a video tutorial that shows you how to call Server-side JavaScript or Java from Client-side JavaScript using Remote Services. The beauty of using Remote Services is the ability to add a callback function, that allows you to continue operations in Client-side JavaScript once your Serve-side code has completed. You can even pass back a result from the backend to your Client-side code.

Step-by-step Guide

Important Notes

 

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.

Related issues