Java Reference
In-Depth Information
8.5. Summary
In this chapter you learned how to expose a stateless session bean as either a SOAP or
RESTful web service. The first half of this chapter focused on SOAP-based web services.
SOAP-based web services are document-centric. We reviewed the basics of SOAP web ser-
vices and covered the structure of WSDL and SOAP messages. We also talked about RPC
versus document web services and the meaning of encoded versus literal. The basic JAX-
WS annotations were covered along with a brief introduction to JAXB. In addition, we
discussed the different approaches that can be taken when developing a web service—for
instance, do you generate the server implementation from a WSDL or let the server gener-
ate the WDSL automatically? In the process, we discussed best practices.
In the second half of the chapter we dived into RESTful web services. A brief introduction
was provided that contrasted RESTful web services with SOAP web services. You saw how
RESTful web services are much simpler and leverage the infrastructure already provided
by HTTP. RESTful web services use the HTTP methods GET , PUT , DELETE , and so on to
implement services—a service is tied to a particular HTTP method and must adhere to its
semantics. A RESTful web service also uses the URI to define the service and incorporates
URL-encoded form parameters. RESTful web services can return text, JSON, XML, and so
on, enabling its output to be customized for the targeted clients. The JAX-RS annotations
were covered along with best practices. In the next chapter we'll begin our exploration of
JPA.
Search WWH ::




Custom Search