Hello
AFAIK cxf does not support it client side and spec is silent on it even if
the api is always associated with server references ("resources"). Maybe
open a feature request, no reason the clientproviderfactory cant support it.
Now for your issue you can wire it in the provider when creating your
client so no real need of the resolver ;)
Le ven. 26 oct. 2018 18:38, exabrial12 <[email protected]> a écrit :
> I'm having trouble finding whether or not this is in the specification or
> not, but lets say I want the JAX-RS client to use a custom JAXB Context
> that
> I universally manage with CDI:
> @ApplicationScopedpublic class JaxbContextResolver implements
> ContextResolver { @Inject private JAXBContext jaxbContext; @Override
> public JAXBContext getContext(Class<?> type) { return jaxbContext; }}
> I then call an endpoint that requires XML:
> ...@Injectprivate JaxbContextResolver jaxbContextResolver;... Client
> client
> = ClientBuilder.newClient(); client.register(jaxbContextResolver);
> client.target("https://example.com
> ").request("application/xml").post(Entity.entity(payload,
> "application/xml"), Response.class);..
> The problem I'm having is that the jax-rs client is never calling my
> jaxbContextResolver.getContext() method. Are ContextResolver[s] supported
> on
> the jax-rs client or is that not in the spec? I did notice that CXF
> attempts
> to use a ContextResolver but it's not finding mine:
>
> https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java#L479
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html