exabrial12
2018-10-26 16:38:09 UTC
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
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