Webservices with Hessian and Burlap

Developing webservices with Hessian or Burlap can be really fun. While Hessian is a binary protocol, Burlap is the XML-based counterpart; both can be used for RPC over HTTP. They can be used to serialize any object but they’re predestined to connect web services. It’s as easy as this:

  • create an interface for your webservice
  • implement this interface in a class that extends either HessianServlet or BurlapServlet
  • deploy a HessianServlet or BurlapServlet in your application server and configure it to use your newly created service
  • use the HessianProxyFactory or BurlapProxyFactory to create an instance of your service that transparently talks to the deployed servlet.

I wrote a little test application that demonstrates the aforementioned steps in action. You can download the Eclipse project as tar.gz or zip or browse the code here. I haven’t used Spring, but if you plan to integrate Hessian or Burlap into your Spring-powered application have a look at the API docs.

If you try to run the code don’t upgrade Hessian to version 3.0.8 as this will result in and infinite loop in the init method of the HessianServlet. This has been reported here and there and it is fixed in version 3.1.2 – so wait until this version reaches the Maven repositories.

Continue reading →