You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Dennis Kieselhorst <ma...@dekies.de> on 2012/11/01 11:34:11 UTC

Re: JAX-RS 2.0 ParamConverterProvider sample

Sergey Beryozkin-5 wrote
> I've prototyped the initial support for it on the client side, can you 
> please experiment with 2.7.1-SNAPSHOT ? Register the custom 
> ParamConverterProvider as provider with WebClient, and it should work 
> for path, matrix, queries, headers

Thank you Sergey. Just tried with the latest build
(cxf-rt-frontend-jaxrs-2.7.1-20121031.113511-18.jar) and my ParamConverter
is not called. It should be included in this build, shouldn't it?

Regards
Dennis



--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5717683.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

It is an oversight. I'll look at the JIRA issue

Sergey
On 23/02/16 12:49, Dennis Kieselhorst wrote:
> Hi,
>
> is there any reason why ParamConverterProvider is not taken into account
> when org.apache.cxf.jaxrs.client.spec.ClientImpl.WebTargetImpl.queryParam is
> used?
>
> Code sample:
>        Client client = ClientBuilder.newClient();
>        client.register(new DateParameterConverterProvider());
>        client.target("url").queryParam("dateOfBirth", myDate);
>
> For CXF WebClient
> org.apache.cxf.jaxrs.client.AbstractClient.addMatrixQueryParamsToBuilder was
> implemented in CXF-5988, but this method is not called when using JAX-RS
> standard client.
>
> Shall I create a JIRA for it or is this intended?
>
> Cheers
> Dennis
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5766185.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Dennis Kieselhorst <ma...@dekies.de>.
Hi,

is there any reason why ParamConverterProvider is not taken into account
when org.apache.cxf.jaxrs.client.spec.ClientImpl.WebTargetImpl.queryParam is
used? 

Code sample:
      Client client = ClientBuilder.newClient();
      client.register(new DateParameterConverterProvider());
      client.target("url").queryParam("dateOfBirth", myDate);

For CXF WebClient
org.apache.cxf.jaxrs.client.AbstractClient.addMatrixQueryParamsToBuilder was
implemented in CXF-5988, but this method is not called when using JAX-RS
standard client.

Shall I create a JIRA for it or is this intended?

Cheers
Dennis



--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5766185.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 06/11/12 10:57, Dennis Kieselhorst wrote:
> Sergey Beryozkin-5 wrote
>> I guess the snapshot with the update has not been deployed yet, I've
>> updated the test code, works for me:
>>
>> http://svn.apache.org/viewvc?rev=1404600&view=rev
>>
>> Please give it another try later
>
> Just ran another test with the latest snapshot. Everything works as
> expected. Thank you!
>
Thanks for the update; FYI, there was a regression caused by this 
enhancement, to do with setting empty query parameters, but was also 
fixed a day ago

Cheers, Sergey

> Regards
> Dennis
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5717969.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Dennis Kieselhorst <ma...@dekies.de>.
Sergey Beryozkin-5 wrote
> I guess the snapshot with the update has not been deployed yet, I've 
> updated the test code, works for me:
> 
> http://svn.apache.org/viewvc?rev=1404600&view=rev
> 
> Please give it another try later

Just ran another test with the latest snapshot. Everything works as
expected. Thank you!

Regards
Dennis



--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5717969.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 01/11/12 12:42, Dennis Kieselhorst wrote:
> Sergey Beryozkin-5 wrote
>> How do you pass a complex object to WebClient, which method is used ? I
>> can quickly test locally
>
> I applied the ParamConverterProvider in the providers list:
>    List<ParamConverterProvider>  providers = new
> LinkedList<ParamConverterProvider>();
>    providers.add(new MyParamConverterProvider());
>    WebClient client = WebClient.create(LOCAL_SERVICE_URI, providers, true);
>
> The complex objects are passed as query params:
>    client.query("complexObjects", object1, object2);
>
I guess the snapshot with the update has not been deployed yet, I've 
updated the test code, works for me:

http://svn.apache.org/viewvc?rev=1404600&view=rev

Please give it another try later

Cheers, Sergey

> Regards
> Dennis
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5717693.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Dennis Kieselhorst <ma...@dekies.de>.
Sergey Beryozkin-5 wrote
> How do you pass a complex object to WebClient, which method is used ? I 
> can quickly test locally

I applied the ParamConverterProvider in the providers list:
  List<ParamConverterProvider> providers = new
LinkedList<ParamConverterProvider>();
  providers.add(new MyParamConverterProvider());
  WebClient client = WebClient.create(LOCAL_SERVICE_URI, providers, true);

The complex objects are passed as query params:
  client.query("complexObjects", object1, object2);

Regards
Dennis



--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5717693.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JAX-RS 2.0 ParamConverterProvider sample

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 01/11/12 10:34, Dennis Kieselhorst wrote:
> Sergey Beryozkin-5 wrote
>> I've prototyped the initial support for it on the client side, can you
>> please experiment with 2.7.1-SNAPSHOT ? Register the custom
>> ParamConverterProvider as provider with WebClient, and it should work
>> for path, matrix, queries, headers
>
> Thank you Sergey. Just tried with the latest build
> (cxf-rt-frontend-jaxrs-2.7.1-20121031.113511-18.jar) and my ParamConverter
> is not called. It should be included in this build, shouldn't it?
>
How do you pass a complex object to WebClient, which method is used ? I 
can quickly test locally

Cheers, Sergey

> Regards
> Dennis
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-2-0-ParamConverterProvider-sample-tp5717610p5717683.html
> Sent from the cxf-user mailing list archive at Nabble.com.