Search code examples
javaodataolingo

Cyrillic in request


When i call request like:

<serverUrl>/objects.svc/objects(<some-cyrillic-str>)

i have error like: "The URI is malformed".

And when i add single quotes, so it becomes like:

<serverUrl>/objects.svc/objects('<some-cyrillic-str>')

i have error like: "The key property 'Id' is invalid".

I think that problem is: URL encoding. In servlet cyrillic part of request URL becomes like: %D7%....etc) and Olingo can't use it.

Q: what is the proper way to use cyrillic in such situations?

UPD: Cyr. part of URL working by js (encodeURLComponent()) and sending. Servlet (and then Olingo) get this part like %D7%... When i try to decode url in filter (before servlet), i have proper cyr. part in filter, but servlet can't to be called by such url anymore.


Solution

  • It was solved by myself. It was silly mistake in Olingo server.

    UPD:
    Mistake was: key property 'Id' was INT type (not STRING). After correction Olingo worked cyrillic string in right way.

    Thanx all.