From time to time, I have wished I had an example of a particular technique I wanted to use in Mule ESB. Those wishes never seemed to come true. So some of the Confluex developers and I decided to make one, and begin creating a series of example projects – a Mule cookbook.
Our first example is the Imperial Manufacturing example. (See our quick guide for help using git with Mule Studio) It is a Mule 3.3 CE application that exposes a simple RESTful web service using the Jersey module. It validates requests using an XML schema, then calls a java SDK, and updates a database using JDBC.
The API that this application demonstrates provides a REST service that accepts orders for droids. These orders are represented as XML documents that must conform to an XML schema:
When the request is received, information from the request is used to call an SDK provided by the droid manufacturing plant. Each of the items is then inserted into the order database so that the finished products can be delivered to their intended destinations.
- Provides a REST web service using the Jersey module and JAXB for XML parsing and generation
- Validates incoming XML requests using XML Schema, and returns a 400 status code when invalid
- Calls a java SDK using spring with information from the request
- Updates a database using the JDBC transport
- Automatically tests each of these things using FunctionalTestCase with an in-memory database and mock objects