I have a question (potential bug?) w/ RequestDumperValve.  I have set up a
simple SOAP like web-service (actually it's Caucho's Hessian protocol) and
when I attempt to use this when also using the RequestDumperValve, my call,
which uses POST, always fails on the server due to the servlet input stream
being close.  The Dumper logs all the correct values from the client
request, but my servlet is passed (from invokeNext()?) a closed input stream
so it can't read the SOAP request.  I poked around in the code and
discovered that this is related to HttpServletRequest.getParameterNames(),
and digging deeper still, found that code in
HttpRequestBase.parseParamaters() actually closes the input stream when
reading the params from a POST:
 
if ("POST".equals(getMethod()) && (getContentLength() > 0)
            && (this.stream == null)
            && "application/x-www-form-urlencoded".equals(contentType)) {
            try {
                int max = getContentLength();
                int len = 0;
                byte buf[] = new byte[getContentLength()];
                ServletInputStream is = getInputStream();
                while (len < max) {
                    int next = is.read(buf, len, max - len);
                    len += next;
                }
                is.close();
                RequestUtil.parseParameters(results, buf, encoding);
            } catch (Throwable t) {
                ;
            }
        }
 
Is there any reason is.close() is called?  Am I doing something wrong?
 
Thanks for any help on this,
-Mark Shaw
 


Reply via email to