Re: [Jayrock] JsonException thown with latin characters

43 views
Skip to first unread message
Message has been deleted

Atif Aziz

unread,
Oct 7, 2011, 12:02:46 PM10/7/11
to jay...@googlegroups.com
Jayrock uses the request encoding[1] so unless the client is not specifying the charset correctly in the request content-type header, Jayrock should be doing the right thing. Are you able to debug either on the server side or sniff the HTTP traffic to see what's really going on the wire?

- Atif


On Fri, Oct 7, 2011 at 2:58 PM, jommac <jmfma...@gmail.com> wrote:
Hi,
I am using jayrock to implement a web service.
From the client side (mobile app) I issue a command and when there are
latin chars in the text I got a JSON Exception.
The request string is encoded as UTF8 string, use POST and  request
Accept field is application/json.

request string:
{"method":"xpto","params":["capa","hello"],"id":"xpto"}               -
> Success
{"method":"xpto","params":["caça","hello"],"id":"xpto"}               -
> Fail

The JSON response is
{"id":null,"error":{"name":"JSONRPCError","message":"Expected a ',' or
'}'.","errors":[{"name":"JsonException","message":"Expected a ',' or
'}'."}]}}

and the JSON Exception thrown:
JSON-RPC (Error): Jayrock.Json.JsonException: Expected a ',' or '}'.
  at Jayrock.Json.JsonTextReader.ParseNextMember()
  at Jayrock.Json.JsonReaderBase.Read()
  at Jayrock.Json.JsonReader.ReadToken(JsonTokenClass token)
  at
Jayrock.Json.Conversion.Converters.AnyImporter.ImportFromString(ImportContext
context, JsonReader reader)
  at
Jayrock.Json.Conversion.Converters.ImporterBase.Import(ImportContext
context, JsonReader reader)
  at Jayrock.Json.Conversion.ImportContext.Import(Type type,
JsonReader reader)
  at Jayrock.JsonRpc.JsonRpcDispatcher.ParseRequest(TextReader input)
  at Jayrock.JsonRpc.JsonRpcDispatcher.Process(TextReader input,
TextWriter output)

Do anybody know how to fix this problem?
Thank you.

--
You received this message because you are subscribed to the Google Groups "Jayrock" group.
To post to this group, send email to jay...@googlegroups.com.
To unsubscribe from this group, send email to jayrock+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jayrock?hl=en.


Reply all
Reply to author
Forward
0 new messages