I've written a Flash-only version of Hessian without any Flex
dependencies.  I split the download into Flex and Flash specific
libraries.  The Flex download has everything in the Flash one, but
the Flash one is much smaller (30k versus 404k).  You can download
it in the snapshot here:

http://hessian.caucho.com/#Flash/Flex

Here's a Hello, World that shows how to use it:

import flash.events.IOErrorEvent;
import hessian.client.HessianAsyncToken;
import hessian.client.HessianProxy;
import hessian.events.HessianResultEvent;
import hessian.events.HessianErrorEvent;

...

private var proxy:HessianProxy = new HessianProxy("/hello-world/hello");

private function sendText():void
{
  var token:HessianAsyncToken = proxy.hello("hello");
  token.addEventListener(HessianErrorEvent.HESSIAN_ERROR, error);
  token.addEventListener(HessianResultEvent.HESSIAN_RESULT, result);
  token.addEventListener(IOErrorEvent.IO_ERROR, ioerror);
}

public function result(event:HessianResultEvent):void
{
  trace("The server said: \"" + event.result + "\"");
}

public function ioerror(event:IOErrorEvent):void
{
  trace("There was an IO error: \"" + event + "\"");
}

public function error(event:HessianErrorEvent):void
{
  trace("There was an error: \"" + event.error + "\"");
}

Let me know if you find any bugs or if the interface needs tweaks or I
missed any Flex dependencies or anything else. :-)

Emil

============================================================

Emil Ong
Chief Evangelist
Caucho Technology, Inc.
Tel. (858) 456-0300
mailto:[EMAIL PROTECTED]

Caucho: Reliable Open Source
--> Resin: application server
--> Quercus: PHP in Java
--> Hessian Web Services


_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to