Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B12D1109F for ; Thu, 18 Sep 2014 08:49:28 +0000 (UTC) Received: (qmail 6413 invoked by uid 500); 18 Sep 2014 08:49:27 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 6345 invoked by uid 500); 18 Sep 2014 08:49:27 -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 6333 invoked by uid 99); 18 Sep 2014 08:49:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2014 08:49:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sberyozkin@gmail.com designates 74.125.82.51 as permitted sender) Received: from [74.125.82.51] (HELO mail-wg0-f51.google.com) (74.125.82.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2014 08:49:01 +0000 Received: by mail-wg0-f51.google.com with SMTP id k14so524411wgh.22 for ; Thu, 18 Sep 2014 01:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=rl0OnvoDAJ8juQAd/Z54rVnsFj1y4Wh2RgjBp/KP5BU=; b=uS9xBhZGEsNZCU+X2Fai+/HSnr4awUNjC9esn0rwBmFticGPi6c2T9dsCsfQzsEhuS re5iDT3Zg4fultYJbGz0bB4xJg8HnmpwveU1EGuTI077iLzL8eiDc6o5R3WVl5Zd5lSG ZM7JowoA5h6TnD7ubwQjjYjwgsa5c1aAaP0Mnsxv7Ziv4fStnex4UWPu7IW4vqr+a1LT j2T/jrjO/Q5D8ZwS4O+E2m4sW+o0X2dn/Yn/toA65m3gNIedrme96cJ/eSfSa4XW3AD/ GSHQEL5Pi3sML2JeuEN9fNMIx191E/93P07timZvJdD778nuvmmOmh4BKvrf9HjFXR5s xycA== X-Received: by 10.180.96.226 with SMTP id dv2mr11400192wib.48.1411030140457; Thu, 18 Sep 2014 01:49:00 -0700 (PDT) Received: from [10.36.226.2] ([80.169.137.63]) by mx.google.com with ESMTPSA id pk9sm25160586wjb.16.2014.09.18.01.48.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 01:48:59 -0700 (PDT) Message-ID: <541A9C68.9080301@gmail.com> Date: Thu, 18 Sep 2014 09:48:40 +0100 From: Sergey Beryozkin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: @Encoded jaxrs client problems References: <5419F554.60601@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi On 17/09/14 22:40, Osvaldo Pina wrote: > I thought that by using @Encoded in client the value would be automatically > encoded. For example: > > consider this method: > @Path("{path}") > @GET > String getPath(@Encoded @PathParam("path") String path); > > If I call call this method using a slashed value on the path param ( > client.getPath("/value/with-slash") ) I tought that the value would be > automatically encoded (from /value/with-slash to %2Fvalue%2Fwith-slash) so > that the slashes in the string would not be confused to the path uri > template. > '/' is not expected to be encoded by default in a URI path component > Is there any way to inform CXF client that I want to encode a parameter? You can use UriBuilder and prepare an encoded path value - UriBuilder should take care of it, you can use its segment() method which would encode '/' or a new method there accepting a boolean flag on whether to encode a slash or not... It is only the issue for '/' client.getPath("value with space") should get "value%20with%20space" produced Cheers, Sergey > > Thanks, > Osvaldo Pina. > > On Wed, Sep 17, 2014 at 5:55 PM, Sergey Beryozkin > wrote: > >> Hi >> On 17/09/14 20:22, Osvaldo Pina wrote: >> >>> Hi, >>> >>> I'm trying to use @Encoded in client jaxrs method parameters and it's no >>> working. Did I miss something or the feature is not avaliable to cxf jaxrs >>> clients? >>> >>> What exactly does not work ? I do not recall doing anything around >> @Encoded on the client proxy side, its semantics on the server is that a >> given value does not have to kept as is, no attempt to decode should be >> made. >> Do you have something not encoded properly by the proxy ? >> >> Cheers, Sergey >> >>> >>> Thanks, >>> Osvaldo Pina. >>> >>> >> > -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ Blog: http://sberyozkin.blogspot.com