Chapter 7. Integrating OSB with JSON

In this chapter, we will cover the following recipes for working with JSON:

  • Converting between XML and JSON
  • Invoking a JSON service from OSB
  • Dynamically binding to a JSON service in OSB
  • Exposing a proxy service as a JSON service

Introduction

Most often, when working with the SOA Suite or Oracle Service Bus, we'll be transforming data between different XML formats. It's becoming increasingly common for services to expect and provide their data in JavaScript Object Notation (JSON).

JSON is a lightweight format, in that it will typically represent data in fewer bytes than the corresponding XML representation, and that it is relatively simple to generate and parse. It is also much simpler than XML, in that it has a smaller set of pre-defined data types (object, array, string, number, and the values true, false, and null) from which an object representation can be constructed.

As a result, we have the blessing and the curse of considerable freedom when deciding how to represent even quite simple values; for example, where XML provides the dateTime type with its standard format, we could choose to use an ISO-8601 conformant string, or the number of milliseconds since an epoch, or an object with named values for each subcomponent. All of those representations would be equally valid in JSON, requiring an agreement between the service provider and clients as to the representation to use, and the interpretation to apply.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.188.121