Web Services in Java are server application that enables a software to work over the Internet. A web service is created and posted on Web Host. Web Host provides this over Internet and allows access to any one.
In simple term two electronic devices when communicate with each other on Internet they use web services . It also acts as a bridge to communicate between software applications.
Characteristics of Web Services:
- Interoperability
- Extensibility
Web Server has a Web API using which web application, desktop application and mobile application communicates with it. A Web API represents a server-side API on a web server and client-side API in a web browser.
A server side API is an interface that defines request-response message system expressed in XML that is exposed by HTTP based Web Server.
Web Services are of two types:
- Big Web Service:
Big Web Service use XML messages and follows SOAP (Simple Object Access Protocol). There systems contain a machine-readable description of the operations. They are written in WSDL (Web Services Description Language). It is used by most of the people around the world. Development tools like NetBeans IDE, etc work around Big Web Services.
While designing, one must keep following points in mind:
A contract including messages, operations, bindings, and the location of the web service must be conveyed to explain the interface that the web service offers.
Web Services must specify a vocabulary for complex nonfunctional requirements like transactions, security, addressing, trust, coordination, etc.
- RESTful Web Services
REST (Representational State Transfer) based web services are integrated with HTTP and do not require XML messages or WSDL service-API definitions. Developing RESTful web services in inexpensive as it uses W3C, IETF (Internet Engineering Task Force).
It has light weight infrastructure. NetBeans IDE development can be used with RESTful web services.
While designing, one must keep following points in mind:
Caching infrastructure helps in the better performance of web services but it should be made sure that caches are limited to the HTTP GET method for most servers.
There are no formal ways to describe web service hence it becomes necessary that both the electronic devices agree on data being exchanged.
Web Services file come with an extension of .asmx. Using a Web Service, a software application works on the internet. There are many implementation of web service.