Database Web Service using Toplink DB Provider

With JDeveloper 11gR2 you can now create database based web services using JAX-WS Provider. The key differences between this and the already existing PL/SQL Web Services support is:

  • Based on JAX-WS Provider
  • Supports SQL Queries for creating Web Services
  • Supports Table CRUD Operations

This is present as a new option in the New Gallery under 'Web Services'

ToplinkDBWS_NewGallery.jpg


When you invoke the New Gallery option, it present you with three options to choose from:

ToplinkDBWS_ThreeOptions.jpg


In this entry I will explain the options of creating service based on SQL queries and Table CRUD operations.

SQL Query based Service

When you select this option, on 'Next' page it asks you for the DB Conn details. You can also choose if you want SOAP 1.1 or 1.2 format. For this example, I will proceed with SOAP 1.1, the default option.

ToplinkDBWS_DBConn.jpg


On the Next page, you can give the SQL query. The wizard support Bind Variables, so you can parametrize your queries. Give "?" as a input parameter you want to give at runtime, and the "Bind Variables" button will get enabled. Here you can specify the name and type of the variable.

ToplinkDBWS_BindVariable.jpg


Finish the wizard. Now you can test your service in Analyzer:

ToplinkDBWS_TestServiceQuery.jpg


See that the bind variable specified comes as a input parameter in the Analyzer Input Form:

ToplinkDBWS_AnalyzerQuery.jpg


CRUD Operations

For this, At Step 2 of Wizard, select the radio button "Generate Table CRUD Service Provider"

ToplinkDBWS_CRUDSelect.jpg


At the next step, select the DB Connection and the table for which you want to generate the default set of operations:

ToplinkDBWS_CRUDTableSelect.jpg


Finish the Wizard. Now, run the service in Analyzer for a quick check.
See that all the basic operations are exposed:

ToplinkDBWS_CRUDTableAnalyzer.jpg
Comments:

Thanks for the tutorial, this is very helpful.

Posted by Web Services on June 21, 2011 at 07:25 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and Tricks from Oracle's JDeveloper & ADF QA

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