Hi Jochen,
That helped me on the way, it works now!
Thanks very much!
One little question in the sideline:
I noticed that there are log constructs in the XmlRpcStreamServer class
like:
log.debug("execute: ->");
This can be annoying because these construct catch the error and print
it to stdout instead of rethrowing it.
Greetz
p.
-----Original Message-----
From: Jochen Wiedmann [mailto:[EMAIL PROTECTED]
Sent: vrijdag 25 augustus 2006 0:26
To: [email protected]
Subject: Re: XML-RPC embedded in Jetty
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]