Professional Documents
Culture Documents
Java web services tutorial provides concepts and examples of two main java
web services api: JAX-WS and JAX-RS. The java web service application can be
accessed by other programming languages such as .Net and PHP.
Java web service application perform communication through WSDL (Web Services
Description Language). There are two ways to write java web service application
code: SOAP and RESTful.
1) JAX-WS: for SOAP web services. The are two ways to write JAX-WS application
code: by RPC style and Document style.
2) JAX-RS: for RESTful web services. There are mainly 2 implementation currently
in use for creating JAX-RS application: Jersey and RESTeasy.
o It should be interoperable.
o Web services can be used to link data between two different platforms.
XML Format: XML is the popular form as request and response in web services.
Consider the following XML code:
1. <getDetail>
2. <id>DataStructureCourse</id>
3. </getDetail>
The code shows that user has requested to access the DataStrutureCourse. The
other data exchange format is JSON. JSON is supported by wide variety of platform.
1. [
2. "employee":
3. {
4. "id": 00987
5. "name": "Jack",
6. "salary": 20000,
7. }
8. ]
Now a question arises, how does the Application A know the format of Request
and Response?
The answer to this question is "Service Definition." Every web service offers a
service definition. Service definition specifies the following: