Join Patrick Royal for an in-depth discussion in this video Introducing SOAP and SOAP toolkits, part of Building Web Services with Java EE.
In this video, I'm going to describe the functions and uses of simple object access protocol or SOAP. This is an XML based protocol that enables the user to exchange information via various other protocols most notably HTTP. This protocol is closely related to WSDL because most WSDL documents are based on SOAP. WSDL documents refer to SOAP protocols as part of their bindings. This determines in which format and under what encodings the message is transferred.
SOAP also holds important information like the location of the recipient and the metadata for the message. But why should we use SOAP? What makes SOAP different from the other types of internet communication between programs? To explore these questions, we should compare soap with the other major communications protocol, remote procedure calls or RPC. These are commonly used to communicate between objects over a distributed component object model, wherein network computers can communicate between a series of software components.
Another common standard used is the common object request broker architecture. RPCs well for these two functions, because they are primarily meant to run on computers within a small well defined network, such as a computing cluster. RPCs don't work as well on HTTP messages because they were not designed with compatibility and security in mind. Firewalls and PROXY servers usually block RPCs due to their security risks. And not all computers can run all RPCs without substantial modification.
Unlike RPC messages, SOAP messages transmit effectively over HTTP with full support for virtually all computers and security systems. Like WSDL, SOAP is language independent and platform independent, communicating purely through XML documents. It is also universally recognized and used, so there are no compatibility problems with different internet browsers. Finally, SOAP Is just simpler to program than RBCs, which is no small matter. In order to create and transmit soap messages, you will need a soap toolkit.
There are several toolkits available for soap but the most commonly used one for Java is the Java API for XML web services, which is abbreviated as jax-ws. This defines the standard Java to WSDL mapping, which automatically translates Java code into a WSDL message using the SOAP protocol. In other words, JAX-WS is the protocol that automatically generated the WSDL documents that appeared when we wrote the Java classes in the previous chapter.
The Java EE platform already includes JAX-WS and the JAX-WS API is the core that the Glassfish server is based on. So there's no need to download and install a separate toolkit. With that out of the way the next video will cover, Starting to Write Messages in SOAP.
- What are Java EE web services?
- Creating a simple service
- Building, packaging, and deploying your service
- Understanding the basic syntax
- Working with WSDL (Web Service Definition Language)
- Exploring SOAP (Simple Object Access Protocol)
- Exploring the syntax and design of REST (Representation State Transfer)
- Programming a web service in Java EE
- Debugging and optimizing your code