views:

129

answers:

2

What is the advantage of using org.apache.xmlrpc.webserver.ServletWebServer instead of or.apache.xmlrpc.webserver.WebServer when working with XMLRPC in JAVA?

Can I use functions that return array of primitives types or nulls with ServletWebServer?

+1  A: 

The documentation sais, that if you use the ServletWebServer you will have the possibility to migrate to another servlet based webserver like Tomcat. I didn't experience any other advantages over the WebServer superclass.

If you still insist in using the WebServer, it is recommended to use its subclass, the ServletWebServer instead, which offers a minimal subset of the servlet API. In other words, you keep yourself the option to migrate to a real servlet engine later.

Daff
A: 

I recall using WebServer to launch a standalone RPC Server in a Swing application. My guess is that when using ServletWebServer you'll need the servlet-api jars.(see @Daff answer)

  • If you're using the library in a non Web application, go for WebServer class, it will probably suit your needs.
  • If you're using Apache XMLRPC in a Web application, why not use their servlet and register your handlers?

Read the Apache XMLRPC documentation to see which type you're able to return and how to add extensions(if needed).

John Doe