Dashboard > RIFE > ... > Webservices > Support for Hessian web services
RIFE Log In | Sign Up   View a printable version of the current page.
Support for Hessian web services


Added by Geert Bevin, last edited by Dan Check on Jan 04, 2007  (view change)
Labels: 
(None)

I stumbled into Caucho's Binary Web Service Protocol which seems very nice for communication between internal application parts. It has been integrated into RIFE in a similar way as SOAP with Axis. There is no concept of auto-deployment through jws files though. To declare a Hessian element you just have to do this, for example:

<element extends="rife/webservices/hessian.xml">
    <property name="service-class">my.hessian.Basic</property>
</element>

With the following Java source classes:

package my.hessian;

public interface BasicApi
{
    public String hello();
}

and:

package my.hessian;

public class Basic implements BasicApi
{
    public String hello()
    {
        return "Hello, world";
    }
}

Assuming that your element is registered in the site structure like this:

<site>
    <element id="BASIC" file="my/hessian/basic.xml" url="/basic"/>
</site>

You'll be able to use the web service like this:

String url = "http://localhost:8080/basic";
HessianProxyFactory factory = new HessianProxyFactory();
BasicApi basic = (BasicApi)factory.create(BasicApi.class, url);
System.out.println(basic.hello());

Which will print

Hello, world

to the standard output.

Pretty easy, no?

Please note that RIFE v. 1.5.1 is compatible with Hessian versions up to and including 3.0.19. The 3.0.19 Hessian jar can be downloaded here: http://caucho.com/hessian/download/hessian-3.0.19.jar



Are you enjoying Confluence? Please consider purchasing it today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.1a Build:#515 May 19, 2006) - Bug/feature request - Contact Administrators