Hi!
Leonardo Carreira wrote:Which one between JAX-WS and JAX-RS that often used for developing Web Service?..
and what is the differences between JAX-WS and JAX-RS?
The answer is: It depends.
It depends on what you want to do and, sometimes, it also depends on who you ask.
Here are some things that come to me in the spur of the moment:
Characteristics of RESTful web services are:
- Performs operations using a limited set of verbs (typically GET, PUT, POST, DELETE) on resources.
- Retrieves a representation of a resource using the JSON or XML data format.
- Uses URLs to address resources.
Example:
http://my.server.com/resources/customer/12/orders/44
This URL would retrieve the customer 12's order 44.
- Always (?) uses HTTP transport.
Characteristics of SOAP web services:
- More choices; different transports (HTTP, JMS, TCP, you could even use mail), security (signature, encryption both whole and partial), can have attachments, can be compressed etc etc.
- With more choices also follows the chance of increased complexity.
- Interface and datatypes described by WSDL document.
- Uses operation names to address functionality.
My advice is: Play around with both RESTful and SOAP web services and get to know them. This way you will increase your chances of making the correct choice when you are to choose which one to use.
Best wishes!