The problem was the server response. A server should not return a string,
even if correctly encoded, because a string is not a valid JSON object.
http://stackoverflow.com/questions/18419428/what-is-the-minimum-valid-json
On Wed, Dec 30, 2015 at 12:06 PM, Sergey Beryozkin
wrote:
> Sorry, I'm get
Sorry, I'm getting confused a bit.
If your service method returns String then this String will be written
out to the output stream and this String is expected to be a correct
representation. The default String provider is correct, the class/etc
parameters are not checked in the code because the
And it at last comes out, what was wrong. It was the server response.
Basically a simple json string should not be returned instead of a json
object.
In other words:
"\/opt\/local\/application\/rest\/" is not a correct JSON object, it is
only a JSON string and should not be returned as response.
Update.
Looking at CXF internals I discovered that StringTextProvider is used to
return the string object.
StringTextProvider implements MessageBodyReader and
MessageBodyWriter;
This is the readFrom implementation (called for MessageBodyReader):
public String readFrom(Class type, Type genTy
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 Beryozki
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.