An Oracle JDeveloper How To Document
Written by Susan Duncan
Install SOAP Client Stack in Oracle Database
Grant Java Permissions to HR Schema
Publish and Run HelloWorld Java Class as Web Service
Create a client-side proxy to call the web service
Load the Java classes into the database
Test your Web Service Call
Web services allow applications to programatically access remote content and application functionality using industry-standard mechanisms, without any dependency on the provider's platform, the location, the service implementation, or the data format.
Database Web services work in two directions: database as service provider, i.e. calling from the outside in, which lets client applications access the database via Web services mechanisms; and database as service consumer, i.e. calling from the inside out, which lets a SQL query or an application module in a database session consume an external Web Service.
This How To document describes the steps to create the files necessary to consume a Java web service in the database. It gives step by step instructions for loading these files into the database and testing the call out to a web service running in Oracle Containers for Java (OC4J). It uses a very simple HelloWorld service as an example. It gives tips on testing and debugging the service.
Full details of all the features of JDeveloper discussed in this article can be found in the JDeveloper Help documentation
This is a one-off install to enable calls from the database to web services. If you have already installed SOAP Client Stack, skip this section. For detailed instructions on installing the stack see Install JAR Files In the Database
Your schema needs the correct Java 2 Permissions. See Chapter9 (Security) of the Database Java Developer's Guide for a detailed explanation. You can check whether the correct permissions already exist using the table browser (see step 4). The example in this HowTo uses the HR schema, you might set the permissions as follows.
This HowTo does not go into the detail of these steps. However, to follow this HowTo here are some tips to create and deploy a web service based on the HelloWorld Java class
public class HelloWorld
public String sayHello(String name)
return "Hello" + name;
Use the context menu of your deployment profile to deploy the profile and the callWS function to your database
|ORA-29541: class HR.mypackage/MyHelloStub could not be resolved
ORA-06512: at "HR.CALLWS", line 0
ORA-06512: at "HR.TEST", line 6
ORA-06512: at line 5
Disconnecting from the database hr16179.
|SOAP stack not loaded|
Ensure that the OC4J instance where your web service is deployed is up and running with your web and that the stub reflects that in its endpoint
|Check that your database schema has all necessary permissions granted. See Grant Java Permissions to HR Schema|
Although the initial release of JDeveloper 10g does not seamlessly support the creation and loading of files required to call web services from the database, it provides tools to achieve these tasks with little hand coding needed from the developer.
|SOAP Client Stack Install|
|Oracle Database Java Developer's Guide|
|OTN Web Services Technology Centre|