Sunday 13 August 2017

I need to learn Web Services in Java. What are the different types in it?

Also, I found that there is a JAX-WS specification for xml based web-services, and JAX-RS specification for creating RESTful webservices.

Q1) I got confused, it would be great if anybody can help me understanding the difference between these different type of webservices, so that I can decide which one to learn first.

Q2) Also, I want to learn in-depth about creating different types of web-services in java. Is there any tutorial or resources which can give an insight to each kind of webservice and a comparison between them.

Q3) based on what scenarios and conditions should I decide that I want to create an XML based web-service rather than a SOAP service or I should go with RESTful service.

Ans

    SOAP Web Services are standard-based and supported by almost every software platform: They rely heavily in XML and have support for transactions, security, asynchronous messages and many other issues. It’s a pretty big and complicated standard, but covers almost every messaging situation. On the other side, RESTful services relies of HTTP protocol and verbs (GET, POST, PUT, DELETE) to interchange messages in any format, preferable JSON and XML. It’s a pretty simple and elegant architectural approach.
    As in every topic in the Java World, there are several libraries to build/consume Web Services. In the SOAP Side you have the JAX-WS standard and Apache Axis, and in REST you can use Restlets or Spring REST Facilities among other libraries.

With question 3, this article states that RESTful Services are appropiate in this scenarios:

    If you have limited bandwidth
    If your operations are stateless: No information is preserved from one invocation to the next one, and each request is treated independently.
    If your clients require caching.

While SOAP is the way to go when:

    If you require asynchronous processing
    If you need formal contract/Interfaces
    In your service operations are stateful: For example, you store information/data on a request and use that stored data on the next one.

What is Map Collection?

A map collection refers to a set of maps that are compiled and organized for a specific purpose, such as research, education, or preservatio...