Thanks Sergey,

but in the meanwhile I tried fruitless different options which include
escapeForwardSlashesAlways(false).
I have also tried to change entirely the implementation, but even Jersey
have the same behaviour.
This is pretty strange to me.

On Tue, Dec 29, 2015 at 7:10 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

> Hi
>
> This is to do with a default CXF JSONProvider which is Jettison based.
>
> Jettison, historically, escapes forward slashes, I don't know why, it was
> there when I started maintaining it.
> What you can do is to configure CXF JSONProvider not to do it, set its
> 'escapeForwardSlashesAlways' to false.
>
> Or use a Jackson provider instead (if you do - Make sure Jettison is on on
> the classpath)
>
> HTH, Sergey
>
>
>
>
> On 29/12/15 14:40, Vincenzo D'Amore wrote:
>
>> Hi All,
>>
>> I don't understand why when I receive a json encoded string this is not
>> decoded automatically.
>> I wrote this code:
>>
>>      Client client =
>> ClientBuilder.newClient().register(JSONProvider.class);
>>
>>      WebTarget target = client.target("http://example.org/rest/service1
>> ");
>>      target = target.queryParam("method", "method1");
>>
>>      Entity<EndpointRequest> entity = Entity.entity(new
>> EndpointRequest("0000"),
>>                             MediaType.APPLICATION_JSON);
>>      Response response = builder.post(entity);
>>
>>         System.out.println( response.getStatus() );
>>
>>         if (response.getStatus() == 200) {
>>
>> // The problem comes here
>>
>>         String basePath = response.readEntity(String.class);
>>         System.out.println( basePath );
>>         }
>>
>> The request is successfully executed but basePath contains
>> "\/opt\/local\/application\/rest\/"  (backslash and double quotes
>> included)
>>
>> basePath should instead contain this:  /opt/local/application/rest/
>>
>> It seems to me, the json deserialization hasn't be triggered when it
>> should.
>>
>> Thanks in advance for your help,
>> Vincenzo
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>



-- 
Vincenzo D'Amore
email: v.dam...@gmail.com
skype: free.dev
mobile: +39 349 8513251

Reply via email to