Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
yes Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn | Book

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread exabrial12
So the @Provider annotation does nothing for the jaxrs client essentially. Is this correct? -- Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
yes Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn | Book

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread exabrial12
So, currently I'm not instantiating it. I tried both managing it with CDI (@ApplicationScoped AND @Provider), no management (Just annotating @Provider) and it didn't get picked up automatically. The only thing that worked was @ApplicationScoped it and calling client.register on the CDI managed

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
Yep, except you instantiate yourself the client outside any container so you are the one to pick it up ;) Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread exabrial12
Actually, I just wrote my own MessageBodyReader/writer, annotated it with @Provider, and it is _definitely not_ being invoked while using the JAXRS client. Is that the expected behavior? It *does* work if you call client.register(), but I thought anything annotated @Provider was supposed to be

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
Here what i has in mind: public class MyClient { private MyClient() { // no-op } public static void main(final String[] args) throws JAXBException { Client client = ClientBuilder.newClient(); try { client.register(new

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread exabrial12
Romain Manni-Bucau wrote > You register you provider(s) and cxf should let it be taken cause user > providers are higher priority for the same media type. Got it, so create our own handlers for XML. Romain Manni-Bucau wrote > The messagebody reader/writer are trivial to impl if you have the

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-27 Thread Romain Manni-Bucau
The messagebody reader/writer are trivial to impl if you have the context so yes, just dont try to reuse cxf but just jaxrs here. Cxf logic is mainly grabbing the jaxbcontext so if you have it no nees of that cxf logic. You register you provider(s) and cxf should let it be taken cause user

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-26 Thread exabrial12
Thanks for the information, I'll take a look at ClientProviderFactory and see what would be involved. I didn't understand what you mean though by "wire it in the provider" though. Is there a way to specify a JAXB Context on the client? -- Sent from:

Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-26 Thread Romain Manni-Bucau
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