Kesha Williams explains web services, the different types of web services, how they communicate, and the advantages to using them.
- [Instructor] Similar to communicating with a friend, two systems on the Internet can talk and share data with each other. Data is shared via web services, and web services share a common language, like XML or JSON. Let's learn about web services, how they communicate, and the advantages to using them. A web service is a software application available over the Internet, used as a means of communication between different software applications running on a variety of platforms and frameworks over a network.
Web services are designed to communicate with other programs or applications, rather than directly with users, and can be remotely invoked. A web service allows two disparate systems, potentially running on different servers, to communicate. In essence, web services allow various applications to talk to each other and share data amongst themselves. These systems could be a combination of Windows or Linux servers, mobile devices, mainframe computers, desktop computers, smartphones, or even another web service.
The means of communication between the two systems is via a standard web protocol like HTTP, or HTTPS, via the World Wide Web. There are two main types of web services. SOAP-based web services. SOAP stands for Simple Object Access Protocol. SOAP is an XML-based web service protocol for accessing web services. RESTful APIs. REST stands for Representational State Transfer.
REST is an architectural style and approach to communications often used in web service development. There are two parties involved in the communication. There is a web service provider, the device, system, or organization providing the data or information, and the service client, the device consuming or requesting the data or information. How does it work? Step one, the web service provider defines a format for requests for its services, and also the response the service will generate.
Step two, the service client device makes a request for the web service across the network. Step three, the web service performs an action, like query a database or perform a calculation, and sends a response back to the service client. While web services can provide data in a number of different formats, XML and JSON are the most common. These standard text-based formats can be easily recognized and parsed by another program that receives the data.
Web services offer many advantages. A few include an easy way to expose business logic and data to other systems in a secure fashion to a wide range of audiences and platforms. Another benefit, web service is a small, reusable component that can be used by multiple systems. This approach can even allow organizations to leverage web services provided by third parties to reduce their own development time, and deliver more powerful applications.
- Comparing when to use JAX-WS vs. JAX-RS
- Using JAX-RS annotations
- Accessing REST resources with JAX-RS
- Creating JAX-WS endpoints
- Writing RESTful services using JAX-RS
- Reading, writing, updating, and deleting data via endpoints
- Mapping to entities
- Error handling
- Testing web services
- Securing Java EE web services