4 Java Web Services I
4 Java Web Services I
✔ Web services are XML-based information exchange systems that use the
Internet for direct application-to-application interaction. These systems
can include programs, objects, messages, or documents.
Three Roles
✔ Service Provider
✔ Service Requestor
✔ Service Registry
exchanged.
continue..
► The interaction involves the three operations: publish, find, and bind.
These operations and roles act upon the web services artifacts.
► The web service artifacts are the web service software module and
its description.
continue..
► Service Provider
From an architectural perspective, it is the platform that hosts
the services.
► Service Requestor
Service requestor is the application that is looking for and
invoking or initiating an interaction with a service. The browser plays
the requester role, driven by a consumer or a program without a user
interface.
► Service Registry
Service requestors find service and obtain binding information
for services during development.
Operations in a Web Service
Architecture
a service description must be published so that a service requester can find the service.
the service requestor retrieves the service description directly. It can be involved
in two different lifecycle phases for the service requestor:
► And, at the runtime to retrieve the service's binding and location description for
invocation.
continue..
► Analysis Phase
► Design Phase
► Coding Phase
► Test Phase
► Deployment Phase
Requirements Phase
► The primary task of deployer is to ensure that the web service has
been properly configured and managed.
► The three vertical towers represent the requirements that are applied
at every level of the stack.
► The text on the right represents technologies that apply at that layer of
the stack. A web service protocol stack typically stacks four protocols:
► Transport Protocol
► Messaging Protocol
► Description Protocol
► Discovery Protocol
(Service) Transport Protocol:
► The bottom three layers of the stack identify technologies for compliance
and interoperability, the next two layer- Service Publication and Service
Discovery can be implemented with a range of solutions.
Web Service Features
XML-Based
► Web services typically use XML (Extensible Markup Language)
as the standard format for data exchange. XML provides a
structured and platform-independent way to represent data,
making it suitable for interoperability between different systems.
Web Service Features
Loosely Coupled
► Web services are designed to be loosely coupled, meaning that the
client and server components can evolve independently.
► The client does not need to have prior knowledge of the server's
implementation details, and changes in one component do not
necessarily require changes in the other.
► A tightly coupled system means that the client and server logic are closely
tied to one another, indicating that if one interface changes, then
another must be updated.
Coarse-Grained
► Web services often follow a coarse-grained approach, where the
operations exposed by the service deal with significant amounts of
data or perform complex tasks. This reduces the number of remote
calls needed, improving efficiency and performance.
❖ Two types
1) SOAP(JAX-RPC, JAX-WS)
2) RESTFUL(JAX-RS)
Types of web service
SOAP Web Services
✔ Disadvantages
► Slow: SOAP uses XML format that must be parsed to be read. It defines
many standards that must be followed while developing the SOAP
applications. So it is slow and consumes more bandwidth and resource.
► WSDL dependent : SOAP uses WSDL and doesn't have any other
mechanism to discover the service.
RESTful Web Services
► Can use SOAP: RESTful web services can use SOAP web services
as the implementation.
► URI Patterns: