cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julio Carlos Barrera Juez <juliocarlos.barr...@i2cat.net>
Subject Re: Sending body in DELETE HTTP Requests with JAXRSClientFactoryBean
Date Wed, 16 Oct 2013 10:49:34 GMT
I tried to use this information before, but I don't know how to solve my
problem.

I have something like this:

ProxyClassLoader classLoader = new ProxyClassLoader();
 classLoader.addLoader(IServiceInterface.class.getClassLoader());
classLoader.addLoader(JAXRSClientFactoryBean.class.getClassLoader());

JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(uri);
bean.setResourceClass(IServiceInterface.class);
 bean.setClassLoader(classLoader);

client (IServiceInterface) bean.create();

Then I can use the client object as usual. But if fails sending DELETE
requests with body.

I tried doing this:

ProxyClassLoader classLoader = new ProxyClassLoader();
 classLoader.addLoader(IServiceInterface.class.getClassLoader());
classLoader.addLoader(JAXRSClientFactoryBean.class.getClassLoader());

JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(uri);
bean.setResourceClass(IServiceInterface.class);
 bean.setClassLoader(classLoader);

// allow body in DELETE requests
Client client = bean.create();
 WebClient.getConfig(client).getRequestContext().put("use.async.http.conduit",
true);

(IServiceInterface) client.whateverMethodThatSendsDelete();

But it didn't work.

What am I missing?

[image: i2cat]
Julio C. Barrera Juez
Office phone: +34 93 357 99 27
Distributed Applications and Networks Area (DANA)
i2CAT Foundation, Barcelona, Spain
http://dana.i2cat.net


On 16 October 2013 12:00, Sergey Beryozkin <sberyozkin@gmail.com> wrote:

> Hi
>
> On 16/10/13 09:18, Julio Carlos Barrera Juez wrote:
>
>> Hi.
>>
>> I'm creating a REST client using JAXRSClientFactoryBean and
>> ProxyClassLoader based on a JAXRS annotated Java interface.
>>
>> I want to send a DELETE with body, which is not recommended by RESTful
>> philosophy, but it is allowed by HTTP 1.1 RFC.
>>
>> The body is not sent by the client and I have read a lot of problems to
>> allow it.
>>
>> Is it possible send a body in my DELETE requests with this configuration?
>>
>>  Please check this thread
>
> http://cxf.547215.n5.nabble.**com/JaxRS-Client-with-Deletes-**
> td5731444.html<http://cxf.547215.n5.nabble.com/JaxRS-Client-with-Deletes-td5731444.html>
>
> Cheers, Sergey
>
>
>
>
>  Thank you!
>>
>> Regards, Julio
>>
>> [image: i2cat]
>> Julio C. Barrera Juez
>> Office phone: +34 93 357 99 27
>> Distributed Applications and Networks Area (DANA)
>> i2CAT Foundation, Barcelona, Spain
>> http://dana.i2cat.net
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message