Creating RESTful Web services

As with traditional Web services, RESTful Web services are created from ZIETrans Integration Objects and their input and output properties. With traditional Web services, you define the location and input and output properties of the Web service resources in a WSDL file. However, with RESTful Web services, you define access to the Web service resources using URIs to represent the resources, HTTP methods to operate on the resources, and HTTP header information to define the message formats.

In the following figure is an architectural view of ZIETrans support for RESTful Web services.
  1. The ZIETrans RestServlet receives from a client an HTTP request with URI and an HTTP method.
  2. The RestServlet routes the request by mapping information in the URI and the HTTP method to a JAX-RS resource for an Integration Object.
  3. The JAX-RS resource receives the request, reads the parameters in the request, initializes the Integration Object, sets prompts (input properties), and runs the Integration Object.
  4. The JAX-RS resource receives extracts (output properties) from the Integration Object, generates a response, and returns it to the RestServlet.
  5. The RestServlet responds to the client.
Figure 1. ZIETrans RESTful Web service architecture
ZIETrans Web service architecture
Note: To run a ZIETrans Integration Object, the client must call one Integration Object at a time. For chained Integration Objects, the client must call one Integration Object, then call the next, passing the link key, or you must modify the wrapper to call one Integration Object after another, passing the link key.

ZIETrans provides tools you can use to create JAX-RS resources for your Integration Objects, and mappings so that URIs and HTTP methods in HTTP requests can be mapped to the correct JAX-RS resources.