Java Web Services


Java Web Services

Web services are typically application programming interfaces (API) or web APIs that is executed on a remote system and can be accessed over a network.

Web services can be divided roughly into two groups, SOAP-based and REST-style.

Advantages of Web Services
Language transparency and Interoperability
Web services and their clients can interoperate even if written in different programming languages. Language transparency is the key to web service interoperability that is the ability of web services and requesters to interact seamlessly despite differences in programming languages, support libraries, and platforms.

Standard and Open infrastructure
Web services are deployed using industry-standard, vendor-independent protocols such as HTTP and XML, SOAP, WSDL, which are ubiquitous and well understood.

Modular design
Web services are meant to be modular in design so that new services can be generated through the integration and layering of existing services, this is the basic concepts of SOA.

Main components in web services include XML, SOAP, and WSAL.
WSDL
The Web Services Description Language is an XML-based language that provides a model for describing Web services.

A WSDL document is a contract between a service and its consumers. The contract provides such critical information as the service endpoint, the service operations, and the data types required for these operations.

SOAP
SOAP stands for as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks.

It relies on XML as its message format, and usually relies on other Application Layer protocols (most notably HTTP and Remote Procedure Call (RPC)) for message negotiation and transmission.

In SOAP-based web services, the SOAP is mostly unseen infrastructure.

Web Services in Java
Java defines some APIs to support web services development such as JAX-WS, JAXP, and JAXB.

It is very easy to develop web services in Java EE5. After write web services interface, and implementation - POJO or EJB, we can just add annotation, @WebService, @WebMethod, @WebResult, @SOAPBinding, @WebServiceProvider(for Restful Web Service) to expose these operations as web services.

The Service Endpoint Interface and Service Implementation Bean
In A SOAP-based web service, there should be an interface that declares the methods, the interface is called the SEI: Service Endpoint Interface and an implementation, which implements the methods declared in the interface, the implementation is called the SIB: Service Implementation Bean.
The SIB can be either a POJO or a Stateless Session EJB.

Restful Web Service
REST stands for REpresentational State Transfer. Roy Fielding coined the acronym in his Ph.D. dissertation to describe an architectural style in the design of web services.

Jersey is reference implementation for building RESTful Web services.
WADL
WADL stands for Web Application Description Language.

WADL can be thought of as the REST equivalent of Web Services Description Language version 1.1. Version 2.0 of WSDL can be used to describe REST Web services, thus competing with WADL.

Resources:
Java Web Services: Up and Running
http://en.wikipedia.org/wiki/Web_service
http://en.wikipedia.org/wiki/SOAP

Labels

adsense (5) Algorithm (69) Algorithm Series (35) Android (7) ANT (6) bat (8) Big Data (7) Blogger (14) Bugs (6) Cache (5) Chrome (19) Code Example (29) Code Quality (7) Coding Skills (5) Database (7) Debug (16) Design (5) Dev Tips (63) Eclipse (32) Git (5) Google (33) Guava (7) How to (9) Http Client (8) IDE (7) Interview (88) J2EE (13) J2SE (49) Java (186) JavaScript (27) JSON (7) Learning code (9) Lesson Learned (6) Linux (26) Lucene-Solr (112) Mac (10) Maven (8) Network (9) Nutch2 (18) Performance (9) PowerShell (11) Problem Solving (11) Programmer Skills (6) regex (5) Scala (6) Security (9) Soft Skills (38) Spring (22) System Design (11) Testing (7) Text Mining (14) Tips (17) Tools (24) Troubleshooting (29) UIMA (9) Web Development (19) Windows (21) xml (5)