Hi,
You can call handleRequestHeader on the ServiceCall before calling invoke. It takes a function that transforms the request, and you can add headers, etc. in that function.
Here is the Javadoc with more details:
This method is useful when the content of the header depend on the context of the request.
However, for services that always require a particular header to be added, it can be better to use a HeaderFilter, which can be declared on the service descriptor and automatically applied on both the client and server side. This is good for things such as authentication, where the headers can be derived from the Principal already available in the request.
This filter adds the current user ID to a header on the client request and extracts it on the server:
And these service descriptors apply the filter:
Cheers,
Tim Moore