Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 60553 invoked from network); 30 Jul 2008 17:57:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jul 2008 17:57:39 -0000 Received: (qmail 33253 invoked by uid 500); 30 Jul 2008 17:57:37 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 33210 invoked by uid 500); 30 Jul 2008 17:57:37 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 33199 invoked by uid 99); 30 Jul 2008 17:57:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2008 10:57:37 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.144.159.82] (HELO EVOX.fluxcorp.com) (69.144.159.82) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2008 17:56:42 +0000 Received: from localhost ([127.0.0.1]) by EVOX.fluxcorp.com for users@cxf.apache.org; Wed, 30 Jul 2008 11:57:06 -0600 Message-ID: <4890AB54.2030003@fluxcorp.com> Date: Wed, 30 Jul 2008 11:56:36 -0600 From: Arul Dhesiaseelan User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: CXF and http body References: <18736318.post@talk.nabble.com> In-Reply-To: <18736318.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org setRequestBody is deprecated in HttpClient 3.x. You should instead use setRequestEntity(RequestEntity). setRequestBody is removed in HttpClient 4.x. AFAIK, Jersey (JAX-RS implementation from Sun) Client API does not support this method. -Arul deniak wrote: > Hi all, > > I'm just starting with web services and CXF and I'd like to know if it's > possible to deal with the request body with CXF. > > I just created a client like that: > > File customer = new File("pathToXMLFile"); > File body = new File("AZipFile"); > PutMethod put = new PutMethod("http://localhost:8080/test/new"); > put.addRequestHeader("Accept", "text/xml"); > FileRequestEntity entity = new FileRequestEntity(customer, "text/xml; > charset=ISO-8859-1"); > put.setRequestEntity(entity); > put.setRequestBody(body); > HttpClient httpclient = new HttpClient(); > httpclient.executeMethod(put); > > > Here's my server: > > @Path("test") > public class TestServlet { > @PUT > @Path("/new") > public String testPut(Customer customer) { > ..... > } > } > > > My question is how do I get the requestBody in my server (i.e. zipFile)?? > I can deal with the customer parameter which is a xml file (from > requestentity) but > not with requestBody? > Has anyone ever done it? > Thanks for your support. > > Ramku >