RPC Framework selection for atitit.js JavaScript

Source: Internet
Author: User

RPC Framework selection for atitit.js JavaScript

1 . DWR 1

2 . using ajaxrpc 1

2 . 2. Data Type mapping table 1

3 . Json-rpc Introduction and use of lightweight remote call protocol 2

3 . 1. 2.3. JavaScript Client Invocation Example 2

3 . 2. 2.4, Direct GET request to call 2

4 . Atiri 3

1. DWR

DWR wants to pick out a method of its own , troublesome .

2. using Ajaxrpc

When calling the RPC method, it is a synchronous call if no callback function is passed, or an asynchronous call if the callback function is Passed.

2.1.1.1. Synchronous Invocation2.1. Data Type mapping table

AJAXRPC supports basic data types, custom classes, and generics are not supported.

datetime

null

TD Style= "width:107.6000pt;" > TD Style= "width:107.6000pt;" >

Javascript

Java

. Net

Php

Description

Number

short,short Span style= "font-family:helvetica; font-size:10.5pt; " >
integer,int
long,long
float,float
double,double

short,int16 Span style= "font-family:helvetica; font-size:10.5pt; " >
int,int32
long,int64
float
double,double

Integer
Float
Double

There are no strict boundaries between numeric types and can be arbitrarily converted

boolean

boolean,boolean

boolean , bool

string

string

string,string

string

 

date

date

string

date string" y-m-d\th:i:s "format, php needs extra processing

object

hashmap,map

hashtable , IDictionary

array

arraylist,list

arraylist , IList

 

null

null

null

 

Ajaxrpc do developers know the difference between static and instance methods?!!  
Static methods always have a copy in memory, which means that memory is always consumed and cannot be freed, while static methods are not conducive to debugging

author :: ★ (attilax) >>>    nickname : old Wow's Paw   (   full name:: attilax akbar al rapanui  Attilax   Baroque   Alpha   rapa Nui   )   kanji name: ayron, Email:[email protected]

reprint please indicate source: http://www.cnblogs.com/attilax/

3.Json-rpc Introduction and use of lightweight remote call protocol

This project can help developers easily implement JSON-RPC remote calls with the Java programming language

The JSON-RPC protocol is very simple and transmits the data format to the server when initiating a remote invocation as Follows:

   { "method": "sayHello", "params": ["Hello json-rpc"], "id": 1}

3.1. 2.3. JavaScript Client Invocation Example

Example of jsonrpcjs-based JavaScript client invocation:

var RPC = New jsonrpc. JSONRPC (' Http://127.0.0.1:8080/index.json ');

Rpc.call (' getsystemproperties ', function(result) {

Alert (result);

});

3.2. 2.4, Direct GET request to call

No need for any client, just manually stitching parameters for remote invocation, the request URL is as Follows:

Http://127.0.0.1:8080/index.json?method=getsystemproperties&id=3325235235235¶ms=jtvijtvk

Parameter description:

Method: Methods Name

Params: call parameters, JSON array format [], the parameters need to be url-encoded before Base64 encoding

Id: Call identifier, Any value

4. Atiri

RPC Framework selection for atitit.js JavaScript

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.