dojo/rpc/JsonService (version 1.10)

dojo/rpc/RpcService

Summary

TODOC

Usage

var foo = new JsonService(args);
dojo/rpc/RpcService
Parameter Type Description
args object

Takes a number of properties as kwArgs for defining the service. It also accepts a string. When passed a string, it is treated as a url from which it should synchronously retrieve an smd file. Otherwise it is a kwArgs object. It accepts serviceUrl, to manually define a url for the rpc service allowing the rpc system to be used without an smd definition. strictArgChecks forces the system to verify that the # of arguments provided in a call matches those defined in the smd. smdString allows a developer to pass a jsonString directly, which will be converted into an object or alternatively smdObject is accepts an smdObject directly.

See the dojo/rpc/JsonService reference documentation for more information.

Property Summary

Method Summary

  • bind(method,parameters,deferredRequestHandler,url) JSON-RPC bind method.
  • callRemote(method,params) call an arbitrary remote method without requiring it to be predefined with SMD
  • createRequest(method,params) create a JSON-RPC envelope for the request
  • errorCallback(deferredRequestHandler) create callback that calls the Deferred errback method
  • generateMethod(method,parameters,url) generate the local bind methods for the remote object
  • parseResults(obj) parse the result envelope and pass the results back to the callback function
  • processSmd(object) callback method for receipt of a smd object.
  • resultCallback(deferredRequestHandler) create callback that calls the Deferred's callback method

Properties

bustCache
Defined by: dojo/rpc/JsonService
contentType
Defined by: dojo/rpc/JsonService
lastSubmissionId
Defined by: dojo/rpc/JsonService
serviceUrl
Defined by: dojo/rpc/RpcService
strictArgChecks
Defined by: dojo/rpc/RpcService

Methods

bind(method,parameters,deferredRequestHandler,url)

JSON-RPC bind method. Takes remote method, parameters, deferred, and a url, calls createRequest to make a JSON-RPC envelope and passes that off with bind.

Parameter Type Description
method string

The name of the method we are calling

parameters array

The parameters we are passing off to the method

deferredRequestHandler deferred

The Deferred object for this particular request

url undefined
callRemote(method,params)

call an arbitrary remote method without requiring it to be predefined with SMD

Parameter Type Description
method string

the name of the remote method you want to call.

params array

array of parameters to pass to method

Returns:instance
createRequest(method,params)

create a JSON-RPC envelope for the request

Parameter Type Description
method string

The name of the method we are creating the request for

params dojo/_base/array

The array of parameters for this request;

Returns:undefined
errorCallback(deferredRequestHandler)
Defined by dojo/rpc/RpcService

create callback that calls the Deferred errback method

Parameter Type Description
deferredRequestHandler dojo/_base/Deferred

The deferred object handling a request.

Returns:function
generateMethod(method,parameters,url)
Defined by dojo/rpc/RpcService

generate the local bind methods for the remote object

Parameter Type Description
method string

The name of the method we are generating

parameters dojo/_base/array

the array of parameters for this call.

url string

the service url for this call

Returns:undefined
parseResults(obj)

parse the result envelope and pass the results back to the callback function

Parameter Type Description
obj Object

Object containing envelope of data we receive from the server

Returns:undefined | Object

Object containing envelope of data we receive from the server

processSmd(object)
Defined by dojo/rpc/RpcService

callback method for receipt of a smd object. Parse the smd and generate functions based on the description

Parameter Type Description
object undefined

smd object defining this service.

resultCallback(deferredRequestHandler)
Defined by dojo/rpc/RpcService

create callback that calls the Deferred's callback method

Parameter Type Description
deferredRequestHandler dojo/_base/Deferred

The deferred object handling a request.

Returns:undefined
Error in the documentation? Can’t find what you are looking for? Let us know!