admin管理员组

文章数量:1391918

I am just getting started with Hessian and have been surprised to discover that there is apparently no library for Hessian functionality (particularly serialization / deserialization) in javascript. I guess I have 2 questions:

1) Is there in fact a decent Hessian library for javascript that I haven't found?

2) If not, is there a good reason why one doesn't exist?

Thanks

I am just getting started with Hessian and have been surprised to discover that there is apparently no library for Hessian functionality (particularly serialization / deserialization) in javascript. I guess I have 2 questions:

1) Is there in fact a decent Hessian library for javascript that I haven't found?

2) If not, is there a good reason why one doesn't exist?

Thanks

Share Improve this question asked Aug 20, 2012 at 10:40 Tom McIntyreTom McIntyre 3,7092 gold badges25 silver badges33 bronze badges 2
  • For all who don't know what Hessian is: hessian.caucho.. – Felix Kling Commented Aug 20, 2012 at 10:47
  • Which version of the Hessian Spec are you looking for, v1 or v2? – JonnyReeves Commented Aug 21, 2012 at 11:14
Add a ment  | 

5 Answers 5

Reset to default 3

A bit of self promotion, I've written a Node.js Hessian parser in JavaScript. It is available in npm or on github.

Currently it only supports decoding hessian data, I've personally not got any need to write the encoder at this point. One thing I was looking for, was some example encoded data that I could use as part of my unit tests. Any suggestions on where I could find some? or do I need to create it myself?

I just write one for RPC calls, similar to ruby-hessian. only available in nodejs. the usage docs is in https://github./villadora/node-hessian. Tested for Hessian v2.0 in http://hessian.caucho./test/test2.

To install:

npm install hessian-proxy

According to their web site, it doesn't look like there's a JavaScript port out there.

Why one doesn't exist? Not sure, but it seems that the developer of Hessian seems to advocate Flash/Flex as the client-side implementation platform of choice. Of course, the web site seems to be a little dated and may have been put together before JavaScript's popularity really took off.

In the end, I succeeded on putting the Bram's library to run in browser. It's ugly code, but it's working. Please take a look https://github./CarlosUrbina/hessianInBrowser

Edit: I realized Bram's library supports only decoding the Hessian 1.0 spec. Unfortunately, my app is running on Hessian 2.0, so I needed to write my own library. https://github./CarlosUrbina/Hessian2Javascript

Is AMD ready and proved to work in Chrome 27 and Firefox 21. Altought, you need to be careful with the same domain policy. If you need to call web services in another domain, this may not work that well.

I only implemented the data types I needed, so the encoding part is just encoding integers. The decoder is more robust, and implementing the lacking types shouldn't be that hard.

npm install hession.js

https://github./node-modules/hessian.js

Hessian Serialization 1.0 and 2.0 written by pure JavaScript. Support all kind of types in Java.

本文标签: Hessian serialization library for javascriptStack Overflow