Archive for February, 2007

JSR 311 - javax.ws.rest

Wednesday, February 14th, 2007

After much talk of such a thing, Dave announces JSR 311 - Java API for RESTful services. This is excellent news - I’m glad to see people are thinking more seriously about RESTful services on Java.

I’m not much of an expert group person, but I’m sure the discussions will be interesting for this JSR. My largest concern would be that we end up with a generic resource framework, but its too far abstracted away from HTTP to allow other protocols which no one will use. Expert group members may be interested in checking out the previous work I’ve done with the Java REST annoations and CXF for some inspiration, although those are really just a small start at what we should be doing with RESTful services. :-)

Update: Brian McCallister points out this section of their text: “Correct implementation requires a high level of HTTP knowledge on the developer’s part.” - Does this sound suspiciously familar to anyone else?

Dodgy Benchmarks Indeed

Thursday, February 8th, 2007

I’ve been meaning to post a follow up to the WSO2 benchmarks for some time. I was hoping to have my own ready, but since InfoQ is carrying them today I would like to respond and with an important point (this is slightly modified from my InfoQ comment).

After looking at their benchmarks I think the latest claim about Axis2 being 2.5% faster than XFire with JiBX is not really true. I noticed that they added in a <soap:Header/> to every message. XFire is optimized for the non header case as that is what most clients will send. Sending a Header will trigger the creation of a JDOM Document to hold the headers in. This is why XFire looks slower in their benchmarks for small messages. For at least 90% of the people out there, XFire will in fact be faster. This also applies to many of the benchmarks in their first posting comparing ADB & JAXB as well.

If WSO2 wants to look at scenarios that use headers, like WS-Addressing or user headers, thats great, and Axis2 might win out there, but this benchmark seems to be about the performance of moving data around without the bells and whistles.

Update: I removed my snippy comments about Axis2 as I don’t know that they were called for. Also, I want to elaborate on the case of headers since Paul Downey raised it in the comments. When there are actual headers in the document, and you are executing logic based on these headers, the document creation time will probably not matter as much. Regardless though, this is a difference of a few percent either way. 5% simply doesn’t matter for web services as your service logic will most likely take more time than that. Now if someone can show me something that doubles performance, that would be noteworthy. However that will be quite tricky to achieve because now the limiting factor in web service performance is probably not XFire or Axis2, its going to be your XML parser, HTTP provider, and/or your data-binding implementation.

Jettison 1.0-beta-1 is released!

Saturday, February 3rd, 2007

I am happy to announce the availbility of Jettison 1.0-beta-1. Jettison is a StAX implementation which reads and writes JSON. It was designed for usage in CXF and XFire to allow easy creation of JSON services side by side with your XML services. For more information about Jettison and downloads see the Jettison website, CXF documentation on JSON, or my earlier blog entry on how to build RESTful services with CXF and Jettison!

For those interested in the change log, this release is primarily focused around bug fixes and small features. The following improvements were included:

  • Element names with “.” are now supported
  • getLocation() no longer returns null
  • Created a switch to allow serialization of attributes without an “@” symbol
  • Fixed a bug in writeCharacters()
  • Several other bug fixes