What is a Web Service ? :
- A webservice is a software function provided at a network address over the web
- It is supposed to be "always on"
- Web services are really nothing more than a request/ response mechanism that allows a client to remotely access/ modify data.
Types of Web Services :
- Big Web Services (Basically StateFull)
( JAX-WS provides the functionality for “big”
web services )
- Big web services use XML messages that follow the Simple Object Access Protocol (SOAP) standard.
A
SOAP-based design must include the following elements.
- A formal contract ,WSDL can be used to describe the details of the contract .
- The architecture must address complex nonfunctional requirements .
Examples
include transactions, security, addressing, trust, coordination, and so on. For More on JAX-WS Refer this link
Basic Component of State
Full Webservices
What is WSDL?
- Web Services Description Language
- based on XML
- describe Web services
- locate Web services
What is SOAP?
- Simple Object Access Protocol
- format for sending messages
- platform independent
- based on XML
What is UDDI?
UDDI
is a directory service where companies can register and search for Web
services.
2) RESTful Web Services (Stateless)
( JAX-RS provides the functionality for
Representational State Transfer (RESTful) web services )
REST
is well suited for basic, ad hoc integration scenarios. RESTful web services,
often better integrated with HTTP than SOAP-based services are, do not require
XML messages or WSDL service–API definitions .
developing
RESTful web services is inexpensive .
Appropriate
for following conditions .
- The web services are completely stateless (A stateless server is a server that treats each request as an independent transaction that is unrelated to any previous request.) A good test is to consider whether the interaction can survive a restart of the server.
- A caching infrastructure can be leveraged for performance. If the data that the web service returns is not dynamically generated and can be cached.
- producer and service consumer have a mutual understanding of the context and content being passed along.