Jump to: navigation, search

EclipseLink/Examples/DBWS/DBWSBasicStoredFunction

< EclipseLink‎ | Examples‎ | DBWS
Revision as of 13:40, 19 May 2011 by David.mccann.oracle.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


EclipseLink DBWS Service based on Stored Function

The use-case for this example is the creation of a Web service that exposes a simple Stored Function.

The following stored function will be used for this example:

DROP FUNCTION TESTECHO;
CREATE OR REPLACE FUNCTION TESTECHO(T IN VARCHAR2) RETURN VARCHAR2 IS retVal VARCHAR2
BEGIN
        retVal := CONCAT('test-' , T);
        RETURN retVal;
END TESTECHO;

The DBWSBuilder utility requires a DBWS configuration file as input.

<?xml version="1.0" encoding="UTF-8"?>
<dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <properties>
    <property name="projectName">testEcho</property>
    ... database properties
  </properties>
  <procedure
   name="testEcho"
   procedurePattern="TESTECHO"
   returnType="xsd:string"
 />
</dbws-builder>
prompt > dbwsbuilder.cmd -builderFile dbws-builder.xml -stageDir output_directory -packageAs wls testEcho.war

where

  • dbws-builder.xml is the DBWS builder XML file above
  • output_directory is the output directory for the generated files
  • -packageAs specifies the platform on which the web service will be deployed