You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Julio Carlos Barrera Juez <ju...@i2cat.net> on 2013/07/29 10:24:43 UTC

JAXRSClientFactory create method accepting basic authentication, base address, class and providers

Hi!

JAXRSClientFactory has a create method accepting basic authentication
parameters (http://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxrs/client/JAXRSClientFactory.html#create(java.lang.String,
java.lang.Class, java.lang.String, java.lang.String, java.lang.String)).
And aI want to use the same parameters plus the providers list.

How can I obtain a proxy client using all the parameters I need? (basic
authentication, base address, class and providers).

Thank you!

Re: JAXRSClientFactory create method accepting basic authentication, base address, class and providers

Posted by Julio Carlos Barrera Juez <ju...@i2cat.net>.
Thank you Sergey. It worked!


On 29 July 2013 11:50, Sergey Beryozkin <sb...@gmail.com> wrote:

> Hi
>
> On 29/07/13 09:24, Julio Carlos Barrera Juez wrote:
>
>> Hi!
>>
>> JAXRSClientFactory has a create method accepting basic authentication
>> parameters (http://cxf.apache.org/**javadoc/latest/org/apache/cxf/**
>> jaxrs/client/**JAXRSClientFactory.html#**create(java.lang.String<http://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxrs/client/JAXRSClientFactory.html#create(java.lang.String>
>> ,
>> java.lang.Class, java.lang.String, java.lang.String, java.lang.String)).
>> And aI want to use the same parameters plus the providers list.
>>
>> How can I obtain a proxy client using all the parameters I need? (basic
>> authentication, base address, class and providers).
>>
>>  Please use JAXRSClientFactoryBean, as it is not possible to capture all
> the combinations with the utility JAXRSClientFactory.
> So you'd do
>
> JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
> bean.setAddress(address);
> // set other properties
> bean.create(MyProxy.class)
>
> HTH, Sergey
>
>> Thank you!
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>

Re: JAXRSClientFactory create method accepting basic authentication, base address, class and providers

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 29/07/13 09:24, Julio Carlos Barrera Juez wrote:
> Hi!
>
> JAXRSClientFactory has a create method accepting basic authentication
> parameters (http://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxrs/client/JAXRSClientFactory.html#create(java.lang.String,
> java.lang.Class, java.lang.String, java.lang.String, java.lang.String)).
> And aI want to use the same parameters plus the providers list.
>
> How can I obtain a proxy client using all the parameters I need? (basic
> authentication, base address, class and providers).
>
Please use JAXRSClientFactoryBean, as it is not possible to capture all 
the combinations with the utility JAXRSClientFactory.
So you'd do

JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(address);
// set other properties
bean.create(MyProxy.class)

HTH, Sergey
> Thank you!
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com