serviceName - Service Name

Name of a client-side JavaScript service.

Category

basics

Syntax

serviceName="name"

Usage

In Design mode, click All Properties and look for serviceName under basics.

This property overrides pathInfo.

Examples

This example exposes a remote service then uses a button with a client-side script to call a service method and redirect its JSON output to the local file system.
<xe:jsonRpcService
id="jsonRpcService1" serviceName="userinfo">
	<xe:this.methods>
		<xe:remoteMethod name="getUserName">
			<xe:this.script><![CDATA[return @UserName()]]&gt;</xe:this.script>
		</xe:remoteMethod>
		<xe:remoteMethod name="add" script="return arg1 + arg2">
			<xe:this.arguments>
				<xe:remoteMethodArg name="arg1"></xe:remoteMethodArg>
				<xe:remoteMethodArg name="arg2"></xe:remoteMethodArg>
			</xe:this.arguments>
		</xe:remoteMethod>
	</xe:this.methods>
</xe:jsonRpcService>
<xp:button value="Display the user" id="button3">
	<xp:eventHandler event="onclick" submit="false">
		<xp:this.script><![CDATA[var deferred = userinfo.getUserName()
deferred.addCallback(function(result) {
	alert(result)
});]]>
		</xp:this.script>
	</xp:eventHandler>
</xp:button>