Closed mladenadamovic closed 13 years ago
It looks like I found a problem, when sending data from java I did send it mistakenly with
out.write(URLEncoder.encode(message, "UTF8"));
instead of only
out.write(message);
since application/json MIME type is definetely not URLEncoded...
Sorry about this... I'll let you know if I encounter other problems.
From Web.xml
My service returns serialized JSON result without problems, but there is a problem with deserialization from JSON. It's configured with
and the method is
I'm testing it using a Java client where I'm sending a
I tested and this string is serializable into OrderCreateRequest, so it's valid JSON. I'm sending this message as Content-Type "application/json".
However, deserialization fails with DeserializationException: The request body could not be deserialized. Encountered unexpected character '%'.
And this is due to code in
This code looks fishy. XmlReader here is {None} in execution. And ReadObject here raises exception in question.
I suspect this is a WcfRestContrib issue or an application config problem, since I don't know what else could be the reason for this. Sending request encoded as application/json to POST in HTTP seems to be valid and my string is validly encoded and can be deserialized into proper JSON. However, somehow I cannot see that WCF/WcfRestContrib is fetching that string properly and there is no more stack trace here so that I can see any more details.
Help or comment would be appreciated.