Reading all parameters from IMxRuntimeRequest (servlet)

1
I'm working on a Paypal widget and it's almost ready. But I have to implement a fraud check: sent all request paramters to a validation server of Paypal. The problem is that it seems to be impossible to get all parameters from an IMxRuntimeRequest (custom Servlet handler). Because I get a dynamically amount of parameters it's not possible to build the parameters list with the IMxRuntimeRequest.getParameter(String) function. Also the function IMxRuntimeRequest.getRequestString() doesn't work, returns always an empty string. Reading from IMxRuntimeRequest.getInputStream() also doesn't work. I think I need a function (feature) like IMxRuntimeRequest.getParameters() that returns a Hashmap of all params, but maybe there's an other way...? UPDATE: problem with getInputStream This is the code I use, that returns always an empty string. I tried to reset the InputStream but that throws an exception. Core.getLogger("Paypal Servlet").log(LogLevel.INFO, "Request on servlet"); String body = PaypalRequestHandler.uitlezenResponse(req.getInputStream()); Core.getLogger("Paypal Servlet").log(LogLevel.INFO, body); public static String uitlezenResponse(InputStream inputStream) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); String response = ""; String line = null; while ((line = br.readLine()) != null) { response += line; } br.close(); return response; } Note: The same issue with HttpServletRequest.getInputStream. Can't read from it, with the code above.
asked
2 answers
1

You can unleash the full javax api on the request/ response objects if you cast their original (wrapped) objects:

HttpServetResponse* resp = (HttpServletResponse) response.getOriginalResponse();

*From the top of my head, might be another class, just inspect in in runtime to detect the proper one.

answered
0

How far with the paypal widget. It is exactly what i need in my projects but am stuck

answered