Thursday Apr 28, 2011

Using JSON with Oracle Service Bus REST Services

I have recently posted 2 new samples for the Oracle Service Bus onto the Oracle Technical Network site. The first sample project is osb-205-SimpleREST and it shows how to fully implement a REST service using OSB. By "fully" I mean it shows how to implement the following HTTP verbs: GET, POST, PUT, DELETE, HEAD and OPTIONS using OSB.

I just finished posting another REST sample for OSB, this one is osb-206-JSONREST which shows you how to have OSB accept and reply with JSON messages. JSON (JavaScript Object Notation) is primarily used on web browsers. Providing XML to javascript clients is not the only way to communicate. JSON is often a preferred method of data exchange, especially with web developers because Javascript can easily parse a JSON object, whereas parsing an XML response requires more infrastructure on the client side.

Due to the nature of JSON, the osb-206-JSONREST sample really focuses on the GET and POST HTTP verbs (the ones easily executed from a web browser). With a little effort, you could easily create robust, production ready REST services thst are able to handle either XML or JSON payloads, depending on the Content-type HTTP header.

You can find all of the OSB samples at the SOA Suite sample site on OTN at: http://java.net/projects/oraclesoasuite11g/pages/OSB Just click on the OSB section on the left side of the page to see the OSB specific samples. The site also provides many samples for other components of the Oracle SOA Suite. It definitely worth a look.

About

A site for SOA thought and discussion.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today