RPC Proxy support hessian 2.0 protocol, with fully tested via test service in http://hessian.caucho.com/test/test2
I couldn't not find a stable hessian 1.0 protocol test service. so 1.0 is not fully implmented yet.
npm install hessian-proxy
var Proxy = Proxy;var proxy = '' username password proxy;proxy;// use writer2var Writer = Writer2; // for hessian2.0var writer = ;writer;var buffer = writer;// use reader2var Reader = Reader2; // for hessian2.0var reader = ;var data = reader;
Binary will be represented by Buffer in node js.
true or false
Represented as Date type.
Just as normal int.
Arrays will be sent as list, typed list need to add a property 'type' to the array. Typed List will have type in 'type' property.
// untyped listvar list = 123;// typed listvar list = 'a' 'b' 'c';list__type__ = '[string';
use Long.js to handle long value.
var Long = ;var long = low high;// orvar long = low: lowbit high: highbit ;
If you don't care about key type, all the keys will be string. the normal Object will be treated as a map. If you want to parse/send maps that use objects as key. You have to expose a ES6 standard Map Class to global namespace.
And typed Map will have type in 'mapType' property.
globalMap = Map;
// normal untyped map, all the key will be stringvar map =1: 1'a': 0'b': 2;// normal typed mapvar map ='a': 0'b': 1;map__mapType__ = 'java.util.Hashtable';// es6 Map, object can be used as keyvar map = ;map;map;map;// add typemap__mapType__ = 'java.util.Hashtable';
The proxy will take the job for you if the objects are equal via strict equal '===='.
To send Object, objects must have a type in 'type' property. Otherwise, it will be send as a map.
var obj ='value': 0'next': 1;obj__type__ = 'com.test.TestObject';
Just as null.
For webservice support call, reply, fault. packet+ and envelope+ current are not supported yet.
Notice: There are some mistakes in the document and make a lot of confuse when writing protocol according to spec, especially when doing test and just find test docs are not correct for some arguments values.
(The BSD License)
Copyright (c) 2013, Villa.Gao <firstname.lastname@example.org>; All rights reserved.