I developed a sample EJB application in JBoss, and published the Web Service according to http://wiki.jboss.org/wiki/Wiki.jsp?page=WSServerEJB.
The server and the client of the application exchange about 10KB messages.
Using the default configuration, I got some performance numbers.
- JBoss 4.0.3
- J2SE 5.0
- 3.0GHz, 3.0GB, Windows XP
For RMI/JRMP, the average response time of a call was 400ms, when 50 threads kept sending requests. The server was fully utilized.
When it comes to WS, the average response time of the same call was 2000ms for just *ONE* thread sent requests. The server was fully utilized, too.
Even though I guessed WS is slower than RMI, it is surprising. About 250 times slower?
Looking forward to comments about this result.
Not too terribly surprising, given that WS has a lot of XML marshalling overhead, as well as HTTP requests are quite slow.
If you could run a Java profiler (JBoss profiler possibly) during the WS test, perhaps you could see exactly what's taking such a long time?