Oracle SOA 12c : Enhance mobile interactions using REST services and JSON

Almost all service development must now be accompanied by its mobile version (more than 1 billion people own a smartphone today).
The concept of REST services with is now widespread, based on HTTP protocol and supports two message formats: XML and JSON.

JSON has a major advantage for mobility: its lightness.
Indeed, this format is certainly less human readable as XML but this is much less « polluted » (by tags that could be described as superficial). Generally, to transfer the same data, JSON is on average 30% lighter than XML.
Moreover, if you have a NoSQL database in your back-end, using JSON can be more natural because most databases use JSON store, including Oracle NoSQL Database with Avro Schemas.
This is a format all-in-fact suitable for mobility because it preserves the maximum bandwidth (valuable in poorly covered areas at the network level), and thus guarantees an optimal speed for data transfer.
Here are the steps to expose a service as REST service:

  1. In your composite, right click on your service and choose « Expose As REST »:10
  2. Then customize your REST binding:
  3. 20 You can customize your operations by choosing among the four basic REST HTTP operations (GET, PUT, POST, DELETE):30
  4.   If you need only a part of the parameters, you can select useless parameters et then click on « Delete »:40
  5. Now you only have your chosen parameters:50
  6.  Go to the « Response » tab, you can allow both XML and/or JSON possible message formats:60
  7. Concerning the payload format, for both message format you can even check if the payload looks like what you expect (if it is in line with the XSD of your service):7080
  8. Finally you can validate the REST binding creation:

  9. SOA engine will generate the REST proxy:100

It’s done!
Your service is now exposed as a REST service. Your customers can enjoy it 🙂