some blag

March 14, 2010

Hessian

Filed under: misc — andrew @ 10:03 pm

Hessian is a binary protocol designed with communication between web services in mind. It can be used to do some interesting things, but here’s a pointless example instead.

On the server side (running in Resin in my case; with Resin you will also need a resin-web.xml):
public class HessianThing extends HessianServlet {
public String insult(String name)
{
return "silly " + name;
}
}

On the client side (Ruby here):
c = HessianClient.new("http://localhost:8080/hessianthing")
puts c.insult("you")

Outputs: “silly you”

The server interface’s (or implementation’s) javadoc is all that is needed for a protocol specification.

Powered by WordPress