Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Created a Quick Summary section and tweaked the structure of the article
Info

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.

Code Block
languagejs
titleBelow is a quick example of Client-side JavaScript calling a RPC function and passing a parameter to it:
linenumberstrue
var myObject = myRPC.RPCFunctionName("param1");
myObject.addCallback( function(result) {
	console.log(result);
});
Code Block
languagexml
titleBelow is an example of the Remote Service Control and a RPC function that calls the actual SSJS Function:
linenumberstrue
<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>
Code Block
languagejs
titleThe below SSJS function is triggered from the Remote Service and returns a result back to the CSJS Function
linenumberstrue
function SSJSFunctionName(param1){
	var result = param1 + " - Success";
	return result;
}

Detailed Overview

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

...

-side code.

Step-by-step Guide

Widget Connector
urlhttp://www.youtube.com/watch?v=R9yFnwWCFdg

Important Notes

...

Video Tutorial

  • While this video was created in a Domino 8.5.2 environment, the basics still apply to this day.

 

Content by Label
showLabelsfalse
max5
spacesOXEXTLIB
showSpacefalse
sortmodified
reversetrue
typepage
labelsrpc,csjs

Page properties
hiddentrue
Related issues