I'm trying to follow the documentation here regarding "Handling headers." I can't figure out how to test service call invocation with headers. Normally, I would just do
service.sayHello().invoke(...)
I noticed that ServerServiceCall
and HeaderServiceCall
accept invokeWithHeaders(...)
and my ServiceCall
is implemented as a HeaderServiceCall
, but whenever I try to change my service API to ServerServiceCall
or HeaderServiceCall
, i get:
Error in custom provider, java.lang.IllegalArgumentException: Service calls must return ServiceCall, subtypes are not allowed
How can I write a test that invokes the service call with custom request headers? I've tried keeping the call as ServiceCall
in the API, implementing with HeaderServiceCall
, and casting the call to HeaderServiceCall
in the test, but I got a cast exception when trying to do that. Any help is much appreciated. Thanks.