I am calling a Java method using Hessian, is it possible to also add HTTP headers before sending a message - so I can add "Authorization" to the header of the message?
I am using Spring, so I currently get a proxy bean and make the call on the proxy:
<bean id="beanRetrievalService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value="http://z.y.z/myService" />
<property name="serviceInterface" value="x.y.z.MyInterface" />
</bean>
You can't add a random header, but HTTP authentication is possible with Hessian. Here is how you would do it programmatically:
I assume the Spring bean has similar setters for the username and the password.