Brief Introduction to Web Services

Let’s start with a brief overview of web services and the basic protocols used in web services: SOAP and WSDL. If you’re already familiar with web services (perhaps from experience developing them on other platforms) and you want to dive into the details of using web services in Java, you can skip directly to the next main section, “Java Web Services.”

A web service is a software component that communicates using XML-formatted messages, transmitted over a standard network protocol such as HTTP (the core protocol behind the Web) or SMTP (the core protocol used by most email servers). These XML messages are formatted using SOAP. A web service can also (optionally) export a description of the service it provides, which includes the operations that it can perform and the specific types and formats of the messages it expects. These service descriptors are typically in WSDL. The WSDL descriptor for a web service describes the types of data, messages, and operations that a web service supports and where the service can be located on the network. A client can use this WSDL service description to automatically generate client-side interfaces to interact with web services.

Web services can also be (optionally) registered with a web service registry. Without a web service registry, a client needs to acquire the WSDL description of the service through some direct, ad hoc channel, such as picking up the WSDL from a local file or loading it from a predetermined ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.