Tool support, as well as ease of development, have also come a long way since 2004. With an increased focus on lightweight frameworks (thanks in part to spring), implementing web services in java could not be easier.
Before you decide to implement web services, you need to answer a simple question. Soap or REST.I guess you are forming your own opinion, but here's what I could think on my head.
Pros of SOAP:
- Great tool support.
- The most common technology.
- The JAX-WS standard is very mature.
- Ease of development. (Annotation support for converting POJO to webservice).
- Example METRO, Axis ...
Against SOAP. (Ask Roy Fielding ..)
- Untied Protocol.
- Protocol configuration is possible, but complex. (using wsdl binding, etc.).
- The client needs a sophisticated library for serializing and deserializing soap messages.
- Platforms such as Android do not natively support SOAP.
After Roy Fieldings exposes the bloated web services protocols webservices , and he puts forward the argument of common sense to use the back of the Internet for SOA, there has been a gradual move to REST. More flexible companies, such as Google and Amazon, have adopted REST and advocate for REST-based web services.
REST Pros:
- Very lightweight protocol.
- Mostly based on HTTP, and therefore most clients know how to consume them. (but REST does not have to be HTTP).
- Error management and ideas like Cache are based on proven Internet technologies.
- Java has excellent REST libraries. Sun own Jersey is an excellent implementation of Jax-RS, and there are Restlet, Jboss Rest Framework and Spring REST (although not compatible with JAX-RS).
Against REST:
- Relatively poor tool support.
- Implementing security in REST is a bit difficult.
- Resource-oriented design and implementation may be new to some traditional programmers and architects.
My preference is REST with Jersey. Its awesome structure, excellent support, excellent documentation, good support libraries for testing.
In any case, I will download the Netbeans IDE and use it to develop skeleton code for the REST or SOAP web service. Netbeans is very easy to get started. Once you are happy with the code, you can switch to your favorite IDE. (By the way, I do not use Netbeans for anything other than prototyping, it tries to do a lot and does most of them poorly .. his opinion is mine anyway)
source share