Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/DBWS/DBWSComplexArgStoredFunction"

(New page: TBD)
 
Line 1: Line 1:
TBD
+
<css>
 +
  .source-sql {padding:4px;}
 +
  .source-java5 {padding:4px;border:1px solid black;}
 +
  .source-xml {padding:4px;border:1px solid black;}
 +
  .source-text {padding:4px;border:1px solid black;}
 +
</css> __NOTOC__
 +
 
 +
== EclipseLink DBWS Service based on Stored Function with complex PL/SQL arguments  ==
 +
 
 +
The use-case for this example is the creation of a Web service that exposes a simple Stored Function containing complex PL/SQL arguments.
 +
 
 +
The following stored function will be used for this example:
 +
<source lang="sql" enclose="div">
 +
DROP FUNCTION F1;
 +
FUNCTION F1(OLDREC IN ARECORD, FOO IN VARCHAR2) RETURN ARECORD IS arec ARECORD;
 +
  BEGIN
 +
    arec.T1 := OLDREC.T1;
 +
    arec.T2 := OLDREC.T2;
 +
    arec.T3 := OLDREC.T3;
 +
    RETURN arec;
 +
  END F1;
 +
</source>
 +
 +
Where type <code>ARECORD</code> is:
 +
<source lang="sql" enclose="div">
 +
  TYPE TBL1 IS TABLE OF VARCHAR2(111) INDEX BY BINARY_INTEGER;
 +
  TYPE TBL2 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
 +
  TYPE ARECORD IS RECORD (
 +
    T1 TBL1,
 +
    T2 TBL2,
 +
    T3 BOOLEAN
 +
  );
 +
</source>
 +
 
 +
The <tt>DBWSBuilder</tt> utility requires a DBWS configuration file as input. <source lang="xml" enclose="div">
 +
<?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>
 +
</source> <source lang="text">
 +
prompt > dbwsbuilder.cmd -builderFile dbws-builder.xml -stageDir output_directory -packageAs wls testEcho.war
 +
</source>
 +
 
 +
where
 +
 
 +
*<tt>dbws-builder.xml</tt> is the DBWS builder XML file above
 +
*<tt>output_directory</tt> is the output directory for the generated files
 +
*<tt>-packageAs</tt> specifies the platform on which the web service will be deployed
 +
 
 +
[[Category:EclipseLink/Example/DBWS]]

Revision as of 11:10, 10 June 2011


EclipseLink DBWS Service based on Stored Function with complex PL/SQL arguments

The use-case for this example is the creation of a Web service that exposes a simple Stored Function containing complex PL/SQL arguments.

The following stored function will be used for this example:

DROP FUNCTION F1;
FUNCTION F1(OLDREC IN ARECORD, FOO IN VARCHAR2) RETURN ARECORD IS arec ARECORD;
  BEGIN
    arec.T1 := OLDREC.T1;
    arec.T2 := OLDREC.T2;
    arec.T3 := OLDREC.T3;
    RETURN arec;
  END F1;

Where type ARECORD is:

  TYPE TBL1 IS TABLE OF VARCHAR2(111) INDEX BY BINARY_INTEGER;
  TYPE TBL2 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
  TYPE ARECORD IS RECORD (
    T1 TBL1,
    T2 TBL2,
    T3 BOOLEAN
  );
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

Back to the top