Search This Blog

Friday, November 16, 2007

Web Services Hints and Tips: JAX-RPC versus JAX-WS, Part 5

Java API for XML-based RPC (JAX-RPC) supports the SOAP with Attachments
(Sw/A) specification, while Java API for XML Web Services (JAX-WS)
supports Sw/A along with the new Message Transmission Optimization
Mechanism (MTOM) specification. The attachment model for JAX-RPC is
Sw/A. Since JAX-RPC was written, a new attachment model has come onto
the scene: MTOM. JAX-WS provides Sw/A support just as JAX-RPC does, but
adds support for MTOM. JAX-WS supports MTOM via the Java Architecture
for XML Binding (JAXB) specification, which includes APIs for marshalling
and unmarshalling both Sw/A and MTOM attachments. In this article the
author examines both models through examples. This tip compares only
the WSDLs and the Java programming models; comparing the wire-level
messages is left as an exercise to the reader. JAX-RPC supports the Sw/A
model. JAX-WS supports Sw/A as well, but it has also stepped up to the
new MTOM model. MTOM is an improvement upon Sw/A in a number of ways:
(1) Everything necessary to create a Java interface is now available
in the WSDL interface; (2) MTOM is usable in a document/literal wrapped
WSDL; (3) MTOM allows optimization to attachments, but it doesn't force
attachments like Sw/A does.

No comments: