Tuesday 17 September 2013

RestyGWT cannot parse JSON?

RestyGWT cannot parse JSON?

I'm trying to make RestyGWT work however I have setup the client-side
service and the JAX-RS web service but when the service is invoked:
service.createStuff(content.getText(), new MethodCallback<String>() {
@Override
public void onSuccess(Method method, String resp) {
GWT.log("Response from server: " + resp);
}
@Override
public void onFailure(Method method, Throwable exception) {
GWT.log(exception.getMessage());
}
});
It throws:
Caused by:
org.fusesource.restygwt.client.JsonEncoderDecoder$DecodingException:
Expected a json string, but was given: {"hash":"jr"} at
org.fusesource.restygwt.client.AbstractJsonEncoderDecoder$9.decode(AbstractJsonEncoderDecoder.java:189)
at
org.fusesource.restygwt.client.AbstractJsonEncoderDecoder$9.decode(AbstractJsonEncoderDecoder.java:1)
Where I can plainly see the response is a valid JSON string. What could I
be missing?

No comments:

Post a Comment