Bellekens, P.A.E. wrote:

XmlRpcLocalStreamServer server = new XmlRpcLocalStreamServer();

You cannot use the XmlRpcLocal stuff. This was simply meant as an example of a streamserver class with custom streams.


LimitedInputStream(getInputStream(), getInputStream().available()));

This is almost definitely wrong. InputStream.available() returns the number of bytes, which are available *now*. However, this number may change, if more data arrives.

Besides, if headers are available, then you should consider subclassing the XmlRpcHttpServer, not the XmlRpcStreamServer.

The only meaningful value is what the client sends as the Content-Length header. If that value is -1 or you don't have access to the Content-Length header, then you shouldn't use the LimitedInputStream.

Without knowing Jetty, I'd assume from your code, that a good example might look like

    public class JettyConnection implements ServerStreamConnection {
        private final InputStream inputStream;
        private final OutputStream outputStream;
        public JettyConnection(InputStream pInputStream,
            OutputStream pOutputStream) {
            inputStream = pInputStream:
            outputStream = pOutputStream;
        }
        public InputStream newInputStream() {
            return inputStream;
        }
        public OutputStream newOutputStream() {
            return outputStream;
        }
    }

    public class JettyServer extends XmlRpcStreamServer {
    }

Now call the JettyServer's method

    execute(XmlRpcStreamRequestConfig, ServerStreamConnection)

by passing an instance of JettyConnection and a suitable configuration object.


Jochen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to