 Loading...
Object RPCClient
Object that provides RPC client functionality.
Members Table
The following table lists the members exposed by the RPCClient object.
|
Show:
Properties |
Methods |
Constants |
|
Attribute |
Readonly |
Description |
Property |
Type |
Readonly |
Description |
async |
Boolean |
false |
Set to false if you need synchronous request. |
state |
Number |
true |
State of the object. |
timeout |
Number |
false |
Request timeout. Default is Infinity. |
Method |
Returns |
Description |
__constructor__
|
RPCClient |
Constructs RPCClient object. |
Sytaxis:
object.__constructor__(endpoint, [version]) Arguments:
Name |
Type |
O/R |
Description |
endpoint |
String |
Required |
RPC end point. |
version |
String |
Optional |
RPC version number. Supported: 1.0, 1.1, 2.0 |
|
abort
|
Void |
Aborts RPC request. |
Sytaxis:
object.abort()
|
call
|
Void |
Makes RPC request with parameters passed and calls callback if succeeded. |
Sytaxis:
object.call(method, [params, callback]) Arguments:
Name |
Type |
O/R |
Description |
method |
String |
Required |
Method name. |
params |
Object |
Optional |
Parameters bag. |
callback |
Function |
Optional |
Callback function. |
|
Event |
B |
C |
Interface |
Description |
Constant |
Value |
Description |
UNINITIALIZED |
0 |
|
SENT |
1 |
|
RECEIVED |
2 |
|
|
Examlpes
Following example invokes "mymethod" method with a parameters bag on "path/to/myendpoint" url.
var oClient = new RPCClient("path/to/myendpoint");
oClient.call("mymethod", {"myparam":"myvalue"}, function(oResult) {
alert(oResult);
});
|