View Full Version : Writing Headers on the Client

11-01-2009, 01:01 PM

I installed Hessian as a servlet on Glassfish server and got my JavaFX client talking with the servlet using the HelloWord example.

Now, I need to set a Basic Authentication header on the client side. How do I write headers for Hessian?

Here is the working code, but without any custom headers:

public void hello() {

String url = "http://localhost:8080/server-war/BasicService";

HessianProxyFactory factory = new HessianProxyFactory();
try {

BasicAPI basic = (BasicAPI) factory.create(BasicAPI.class, url);

System.out.println("hello(): " + basic.hello());
} catch (Exception e) {}

Thank you.

12-22-2009, 06:06 PM
For the specific basic authentication, you can call setUser and setPassword on HessianProxyFactory.