Manish Jethani ([info]mannu) wrote,
@ 2006-07-19 23:57:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:flex, hacks

hessian.swc: Hessian client interface for ActionScript 3 (Flash) programs

What is Hessian?

The Hessian binary web service protocol makes web services usable without requiring a large framework, and without learning yet another alphabet soup of protocols. Because it is a binary protocol, it is well-suited to sending binary data without any need to extend the protocol with attachments.

And here's my AS3 implementation of the protocol: hessian.swc.

The hessian.swc library can be used by Flash 9 and Flex 2 applications for communicating with Hessian-based web services.

To make a remote call, create an instance of the HessianProxy class with the service URL as an argument to its constructor. When you call a method on the HessianProxy instance, it'll invoke the corresponding method on the server. Serialisation and deserialisation of method arguments and return values is done transparently.

e.g.

var proxy:Object = new HessianProxy(
  "http://www.caucho.com/hessian/test/basic");

var token:* = proxy.subtract(5, 3);

token.addEventListener("reply",
  function (event:*):void {
    var result:int = event.value;
    trace("result: " + result); // "2"
  }
);

Since remote calls in Flash are asynchronous, the return value is available in the reply event.

You can also send and receive complex types, arrays, binary data, and pretty much everything in the specification (except the long and date types, as of now).

The library is available under the terms of the GNU General Public License.




Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…