Recent articles:
Popular archives:
Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can,
or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing
heavily in Java's future as a platform for platforms
Also see:
Discuss: Java: A platform for platforms?
If you haven't been keeping up with what Sun Microsystems has been cooking up for the next release of Java, here is a wakeup call: For months now, Sun has been providing early releases of binaries, Javadocs, and source code for Java Platform, Standard Edition 6 (Java SE is Sun's new name for J2SE), also known as Mustang. And it is not too late to hitch your wagon to this galloping horse.
An obvious question is, "Why should I care?" For the skeptic, Java SE 6 has improvements across the board, from opening programmatic access to the Java compiler, to system-tray and splash-screen components, to mixing scripting languages with your Java source code (with JavaScript supported out-of-box), to a dapper look and feel in Swing, to XML digital signatures, to the Smart Card I/O API, to JMX monitor threading improvements, to Web services annotations for service providers and simplified client access—to name just a few of the new features coming our way. (The java.net Website provides everything you wanted to know about this new release.)
In this article, we focus on the improvements to the Web Services Metadata specification and Java API for XML Web Services
(JAX-WS) 2.0 in Java SE 6 that make both development and consumption of Web services quite easy. Using these new features,
we create a Web service from a simple Java class by merely slapping on annotations; thereafter, we consume this service using
JAX-WS 2.0. We even add a handler to the service that intercepts the service call and dumps the SOAP messages to System.out.
Actually, these features have been available as after-market downloads that implement Java Specification Request 181 (Web Services Metadata) and JSR 224 (JAX-WS). Having these features part of the standard Java release makes them more mainstream; expect to see proliferated support in IDEs soon.
JSR 181 and JSR 224 are also part of Java EE 5, which allows application vendors to supply hosting platforms for Web services based on the standard specification. Ideally, such functionality would allow inchoate Web service applications deployed on just the Java SE 6 Java Runtime Environment to scale to large workload deployments by using application servers that support the same specifications without codebase changes—reality aside, that is at least the hope.
Before we let the horses out of stables, download the zip file that accompanies this article. It contains the following four files (the jar files are just for convenience):
Note: You'll need Java SE 6 and Apache Ant to work with this article's example.
After you unzip the files, you will have two folders, mustangws and mustangwsclient, with each corresponding to a server and client application. Both projects have the familiar src folder containing Java source files and Apache Ant's build.xml under it. There are additional wsgenMustang.bat and wsimportMustang.bat files that contain console commands for generating Web service artifacts and stubs, which I cover later in this article.
Archived Discussions (Read only)