| |  | |
| | |
| | I stumbled into [Caucho's Binary Web Service Protocol|http://caucho.com/hessian] 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: |
| | |
| | {code:xml} |
| | <element extends="rife/webservices/hessian.xml"> |
| | <property name="service-class">my.hessian.Basic</property> |
| | </element> |
| | {code} |
| | |
| | With the following Java source classes: |
| | |
| | {code:java} |
| | package my.hessian; |
| | |
| | public interface BasicApi |
| | { |
| | public String hello(); |
| | } |
| | {code} |
| | |
| | and: |
| | |
| | {code:java} |
| | package my.hessian; |
| | |
| | public class Basic implements BasicApi |
| | { |
| | public String hello() |
| | { |
| | return "Hello, world"; |
| | } |
| | } |
| | {code} |
| | |
| | Assuming that your element is registered in the site structure like this: |
| | |
| | {code:xml} |
| | <site> |
| | <element id="BASIC" file="my/hessian/basic.xml" url="/basic"/> |
| | </site> |
| | {code} |
| | |
| | You'll be able to use the web service like this: |
| | |
| | {code:java} |
| | String url = "http://localhost:8080/basic"; |
| | HessianProxyFactory factory = new HessianProxyFactory(); |
| | BasicApi basic = (BasicApi)factory.create(BasicApi.class, url); |
| | System.out.println(basic.hello()); |
| | {code} |
| | |
| | Which will print |
| | {noformat}Hello, world{noformat} |
| | 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 |