Saturday, 23 April 2011

Java: JAX-WS web services and clients

JAX-WS is built into Java 6. This makes it a low-dependency choice for writing SOAP-based web service code. This post covers the basics of JAX-WS development with a sample web service.

An understanding of the following is beneficial: Servlets; XML Schema Definition (XSD); Web Services Description Langauge (WSDL); XPath; JAXB.

Server code was tested on Glassfish 3; client code was tested on Java 6.

The code here describes a contract-first web service; it is possible to do this the other way round, starting with Java code and generating descriptors from it.