Hi all,
I'd like to setup a single entry point for a partner in order to let him access a few services.
My server is build around B4J's jServer and I already added a Server Handler to my running code.
Everything works fine as long as the incoming "query" comforms to what's expected, but how can I protect the service against a malformed query?
I mean, I expect as input a JSON string following a simple construct (which specifies, among other things, the wanted service and its parameters).
Should I put everything in a try/catch section?
I'd like to catch problems such as:
- the input string is not a JSON string
- the input string is in JSON format but follows a scheme not allowed/expected (e.g. a map instead of a list)
- no string sent to the entry point
So, what I like to achieve is kind of a syntactic check. Once that's ok I would proceed to check eaach field for allowable values.
Other measures I'm evaluating are the frequency I should change the auth token, the number of enquiries accepted in a defined time frame. Can you suggest other key points to keep the service run as safe as possible? TIA
udg
I'd like to setup a single entry point for a partner in order to let him access a few services.
My server is build around B4J's jServer and I already added a Server Handler to my running code.
Everything works fine as long as the incoming "query" comforms to what's expected, but how can I protect the service against a malformed query?
I mean, I expect as input a JSON string following a simple construct (which specifies, among other things, the wanted service and its parameters).
Should I put everything in a try/catch section?
I'd like to catch problems such as:
- the input string is not a JSON string
- the input string is in JSON format but follows a scheme not allowed/expected (e.g. a map instead of a list)
- no string sent to the entry point
So, what I like to achieve is kind of a syntactic check. Once that's ok I would proceed to check eaach field for allowable values.
Other measures I'm evaluating are the frequency I should change the auth token, the number of enquiries accepted in a defined time frame. Can you suggest other key points to keep the service run as safe as possible? TIA
udg