Blog entries in category "All" shown here:
Show entries in category :
Whateveah | Java | All
20060818 Friday August 18, 2006

RESTful Web Services with JAX-WS

Here is my article on RESTful Web Services and some best practices to consider when developing them with JAX-WS.
( Aug 18 2006, 12:00:00 AM EDT ) Permalink Comments [1]
20060816 Wednesday August 16, 2006

JAXWS 2.0.1 Performance Improvements

JAX-WS 2.0 shipped as an FCS version before JavaOne (2006/05/09). JAXWS 2.0.1 is a overhaul of JAXWS 2.0 RI for improved performance and better pluggability to allow other technologies like WSIT to be layered on top. It still conforms to the same JSR spec. The team has spent a lot of cycles trying to optimize JAX-WS performance and the results can be seen in the graph below.
Between JAX-RPC and JAX-WS 2.0.1 (ie the rearchitected implementation), performance has impoved between approximately 70% depending on the test cases. The graph below shows a comparison of JAX-RPC vs JAXWS 2.0 and JAXWS 2.0 vs JAXWS 2.0.1

JAXRPC vs JAX-WS 2.0

JAXWS 2.0 vs JAX-WS 2.0.1

JAX-RPC 1.1 vs JAX-WS 2.0.1

JAX-WS 2.0 was a rewrite from ground up of JAX-RPC and included a lot of new features (like integration with JAXB 2.0) which contributed to a slight regression in performance. Performance has been at the center of the implementation rearchitecture.Some enhancements include
  • Revisiting some of the key abstractions
    • For example. avioded using StAX and going straight from JAXB to OutputStream. This reduces the number of layers and avoids the escaping, character encoding and namespace management done by StAX.
    • Better handling of properties Prior to JAXWS 2.0.1 a HashMap was used to hold properties that were all pre-evaluated and in fact read more often than written.In JAX-WS 2.0.1 a distributed property set with lazy evaluation is used.
  • Collapsing the stack where ever possible
    • For example, initially a byte image of the whole message was kept around and a DOM built for the whole message to access headers. This inadvertently led to XML being parsed twice.
      To avoid this JAXWS 2.0.1 uses a stream buffer which records infoset to necklace-like data structure and allows it to be replayed later. It's not randomly accessible though.
      It supports various XML API's. Eg reads via XMLStreamReader and writes via XMLStreamWriter; or fire SAX events to ContentHandler.
  • Reducing the number of special purpose interfaces.
    • For example no more custom hooks for JavaEE
    • Better handling of endpointaddress property. In JAXWS 2.0 implementation this was stored in a string and then converted to a new URL() everytime. In the 2.0.1 implmentation its stored as a URL in the distributed property set and a URI is created for storing proxy information which is used by the JDK's URL.openStream()

( Aug 16 2006, 01:30:00 PM EDT ) Permalink Comments [0]
20060812 Saturday August 12, 2006

SWE 645 @ George Mason University

I was pleased to find out that another graduate level course is using my book on Web Services as a text book. SWE 645 at George Mason university.
( Aug 12 2006, 05:01:27 PM EDT ) Permalink Comments [0]