Java Web Services

There are several standard APIs for implementing and using web services in Java. The principal ones we’ll discuss here are the Java API for XML Remote Procedure Calls (JAX-RPC), the SOAP with Attachments API for Java (SAAJ), and the Web Services for J2EE specification. JAX-RPC and SAAJ are APIs aimed at helping you develop both web services and web service clients. These web service clients might be standalone Java applications or code running within a J2EE application (e.g., JSP or servlet web components, EJBs, etc). The Web Services for J2EE specification describes a standard approach for the packaging and deployment of web services.

Relative to the standard web service protocols discussed earlier (SOAP, WSDL, etc.), JAX-RPC and SAAJ together provide a standard Java framework for consuming SOAP messages from web services and for generating SOAP messages and delivering them to web services. In a sense, you can think of JAX-RPC and SAAJ as being in the same category as other remote object APIs in Java, such as RMI and the Java bindings of CORBA. The web service APIs in Java use a different set of protocols to accomplish their remote object and messaging services.

Mapping SOAP and WSDL to Java

JAX-RPC provides more than just an API for consuming and producing web services. It also defines standard mappings from SOAP and WSDL entities to Java entities and back again. This is a very important asset, since it makes it clear how various web service data types will be ...

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.