JsonService.invoke

Calls a service method by specifying a method name, an array of parameters and a callback and error handler method.

o.JsonService.invoke(method, params, callback, errorCallback, isBare)

Parameters

method
The service method to call

params
An object with properties named for each of the server parameters that the called method receives. This should be passed as a map. For example to pass to parameters such as symbol and years you'd pass:

{ symbol: "MSFT", years: 2 }

callback
The callback method that is called when the call returns. Receives a result parameter that is the result JavaScript value .

errorCallback
The method called when an error occurs. Receives an error parameter that contains an error object with a message and callStack property.

isBare
Determines how the result data is returned from the server. By default (false) messages are returned in 'wrapped' format which wraps the result in a containing object which is normalized by the method. If set to true the message is assumed to be bare containing the result value directly. This matches WCF message formatting options (WebMessageStyle.Bare/Wrapped). ASMX services always return wrapped messages.


See also:

Class JsonService

© West Wind Technologies, 1996-2022 • Updated: 03/28/09
Comment or report problem with topic