Javascript|web
Web Remote Procedure Call (hereinafter referred to as WEBRPC) is not a refreshing page, under the premise of the remote method calls, is a recent hot spot; In some cases, he even becomes an irreplaceable way of implementation. WEBRPC implementation of the way experienced from the ordinary URL reading, hidden frames, IFrame, XMLHTTP and even flash. This paper will make a list of the existing WEBRPC scheme (products) and make a simple evaluation.
Evaluation will be done in the following ways: client implementation, server-side implementation, whether to encapsulate the protocol itself, whether to support serialization/deserialization, serialization support is complete (atomic type, object type), whether asynchronous/synchronous mode is supported. Note that remote calls to Web methods are not being used on a large scale. The author has not used the WEBRPC experience in the enterprise application, but in the entertainment application, the on-line game, has obtained the quite good application. These applications have been discussed in detail in the Web application for asynchronous messaging (Amowa) and are interested in reading this article in the Product Guide section.
1 MSRs (Microsoft Remote scripting)
Address:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/Html/rmscpt1.asp
Introduction: In the early days of the Web page, the browser function is limited. The advent of applets provides a platform for MSRs. In this scenario, MSRS interacts with the server side through an applet class and a parameter configuration on the page, enabling remote invocation. Using this technique, the work of the page does not refresh is handed over to an invisible applet named Rsproxy.class. I've seen early online web chess adopt this option. Advantages: Easy across the browser; disadvantages: server-side using Microsoft ASP, applet loading slow; Data type serialization/deserialization is not supported.
2 JSRs (Javascript Remote scripting)
Address:http://www.blueshoes.org/en/javascript/jsrs/
Introduction: Support two types of data access: HTTP GET mode (dynamic load JS file), HTTP POST mode (with JS dynamic create an IFRAME, in which a form to submit). You do not need to refresh the page to support the serialization/deserialization of simple data.
3 XML-RPC
Address:http://www.xmlrpc.org/
Introduction: XML-RPC defines a protocol specification that, because of its lightweight, conceptual integrity, is now implemented in most languages, including Java (Apache XML-RPC), PHP, JavaScript, VBScript, Python, and so on. The largest Communication Mode blog protocol, management methods also follow the XML-RPC specification. Advantages: Most languages are supported, simple, and normative. Disadvantage: Java implementations have limited support for serialization of data types
4 Dwr (Direct Web Remoting)
Address:https://dwr.dev.java.net/
Introduction: A small thing that presents appropriate concepts in due course. Using the XMLHTTP delivery request, the server side uses reflection to find the corresponding method execution to return the result. More creative is that he will be the server side of the remote call to the code dynamically converted to the corresponding JS code, the front-end can be directly explicit call. Simple and can be used as a primer for WEBRPC learning. Data serialization is not supported
5 JSON-RPC
Address:http://oss.metaparadigm.com/jsonrpc/
Introduction: Using an unheard of data interchange protocol JSON (JavaScript Object notation, http://www.crockford.com/JSON/) as the basis for the Protocol, on which data calls, Use XMLHTTP Send/Accept request, support complete data serialization/reverse sequence. Currently, the Jason Web framework uses JSON-RPC as the underlying approach.
6 Burlap (http://caucho.com/burlap/index.xtp)
Introduction: It may be strange why burlap can also be considered a remote protocol. In fact, the burlap (the former is binary, the latter is text) is essentially the same as the Hessian implementation, and can exceed any of the above products on protocol integrity. At present, I have implemented JS call Burlap service Code, is currently all remote invocation of the most elegant implementation of the way.
7 Xins (XML Interface for network Services)
Address:http://xins.sourceforge.net/index.html
Introduction: According to the official website, SOA + Java + XML + code_generation-complexity => xins. This huge thing needs to define a package description file before it can be invoked in HTML. In appearance, this is the most like solution. Do not know much about it, do not do evaluation.
8 WebService, SOAP
Introduction: In addition to Microsoft has a WEBSERVICE.HTC control, Mozilla also has a corresponding WebService access mode. Therefore, it is also possible to access WebService in HTML. It's just that the protocol is unwieldy, and no one is going to use it in a Web client unless necessary.
Sync + asynchronous
|
How the client is implemented |
How server-side implementations |
Whether to encapsulate the protocol itself |
Serialization/deserialization |
Synchronous Mode/Asynchronous mode |
msrs |
applet |
|
|
|
Sync + asynchronous |
jsrs |
iframe/dynamically load JS |
various, PHP, Java, etc. |
|
|
sync |
xml-rpc |
xmlhttp a variety of ways |
|
xml-rpc |
| TD style= "BORDER:0;PADDING:0;" >
dwr |
xmlhttp |
|
no |
|
Sync + asynchronous |
json-rpc |
xmlhttp |
|
json | " TD style= "BORDER:0;PADDING:0;" >
Sync + asynchronous |
burlap |
xmlhttp |
|
burlap |
full support |
Sync + asynchronous |
xins |
xmlhttp |
|
is |
|
Sync + asynchronous |
WebService |
IE adopts. HTC, Mozilla built-in support |
Indefinite, follow the WebService specification and the SOAP protocol |
Soap |
Support, with extensions on different platforms |
Synchronous + Asynchronous |