Description of problem: (code snippets are from ClientInvoker class)
It is possible to set the accept http header in a rest composite binding(to invoke an external WS) reference using the @Produces annotation on the corresponding JAX-RS method:
_accepts = MediaTypeHelper.getProduces(_resourceClass, method, null);
It however might not be suitable for some cases because it adds " to the header in some cases, for example if we use the following:
@Produces("/;test=true")
The Accept header will be:
/;test="true"
So we need to set this header in another way.
Setting using Context Mapper will lead to the Accept header to be duplicated and this happens because of the ClientInvoker class, that always add the header we set in the interface:
if (_accepts != null) { request.header(HttpHeaders.ACCEPT, _accepts.toString()); }
The result is a duplicated header which leads to errors.
Version-Release number of selected component (if applicable):
FSW 6.0
How reproducible: always
Steps to Reproduce: 1. Create a FSW application that invokes a REST WS using REST Binding Reference; 2. Sets a header on the JAX-RS method using the @Produces annotation with the value "/;test=true" 3. Try to set the header using other ways as well
Actual results:
Inspect the generated HTTP request and it contains a header Accept with the following value:"/;test="true".
If you use other ways to set the header, the value will be duplicated.
Expected results:
The value should be /;test="true"
|