| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> |
| <meta http-equiv="Content-Style-Type" content="text/css" /> |
| <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
| <title>Creating from an Overloaded PL/SQL Stored Procedure | EclipseLink 2.6 EclipseLink DBWS</title> |
| <meta name="generator" content="Oracle DARB XHTML Converter (Mode = document) - Version 1.0.22 Build 1" /> |
| <meta name="date" content="2014-06-10T10:32:29Z" /> |
| <meta name="robots" content="noarchive" /> |
| <meta name="doctitle" content="Creating from an Overloaded PL/SQL Stored Procedure" /> |
| <meta name="relnum" content="Release 2.6" /> |
| <link rel="stylesheet" type="text/css" href="../../dcommon/style.css" media="screen" /> |
| <link rel="copyright" href="../../dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> |
| <link rel="start" href="../../index.htm" title="Home" type="text/html" /> |
| <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> |
| <link rel="prev" href="creating_dbws_services008.htm" title="Previous" type="text/html" /> |
| <link rel="next" href="advanced_methods.htm" title="Next" type="text/html" /> |
| <!-- START: Disqus --><script type="text/javascript"> var disqus_developer = 0; </script><!-- END: Disqus --><!-- START: Sharethis --><script type="text/javascript">var switchTo5x=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript" src="http://s.sharethis.com/loader.js"></script> <!-- END: Sharethis --></head> |
| <body bgcolor="#FFFFFF"><iframe id="docheader" frameborder="0" framemargin="0" scrolling="no" src="../../dcommon/header.html"></iframe><script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchOptions = {}; var googleAnalyticsOptions = {}; googleAnalyticsOptions['queryParameter'] = 'q'; googleAnalyticsOptions['categoryParameter'] = ''; customSearchOptions['googleAnalyticsOptions'] = googleAnalyticsOptions; var customSearchControl = new google.search.CustomSearchControl( '016171230611334810008:1hjujor5_fg', customSearchOptions); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setSearchFormRoot('cse-search-form'); customSearchControl.draw('cse', options); }, true);</script><link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /><div id="cse" style="width:100%;"></div> |
| <div class="header"><a id="top" name="top"></a> |
| <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> |
| <tr> |
| <td align="left" valign="top"><font face="helvetica, arial, sans-serif"><b>Developing Persistence Architectures Using EclipseLink Database Web Services</b><br /> |
| <b>Release 2.6</b><br /> |
| </font></td> |
| <td valign="bottom" align="right" width="144"> |
| <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> |
| <tr> |
| <td> </td> |
| <td align="center" valign="top"><a href="toc.htm"><img src="../../dcommon/images/contents.png" alt="Go To Table Of Contents" border="0" height="16" width="16" /><br /> |
| <span class="mini">Contents</span></a></td><td> </td><td align="center"><a href="../../" target="_top" class="external text" title="Other searches" rel="nofollow"><img src="../../dcommon/images/search.png" alt="Search" style="border:0;" /><br /><span class="mini">Other Searches</span></a></td><td> </td><td align="center"><a href="../eclipselink_moxy.pdf" title="PDF" target="_blank"><img src="../../dcommon/images/pdf_icon.png" style="padding-right:5px;border:0" alt="PDF"><br /><span class="mini">PDF</span></a></td><td align="center"><a href="#disqus_thread" title="Comments""><img src="../../dcommon/images/comments.png" style="padding-right:5px;border:0" alt="Comments"><br /><span class="mini">Comments</span></a> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| <hr /> |
| <table class="navigation simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100" align="center"> |
| <tr> |
| <td align="center"><a href="creating_dbws_services008.htm"><img src="../../dcommon/images/larrow.png" alt="Previous" border="0" height="16" width="16" /></a></td> |
| <td align="center"><a href="advanced_methods.htm"><img src="../../dcommon/images/rarrow.png" alt="Next" border="0" height="16" width="16" /></a></td> |
| <td> </td> |
| </tr> |
| </table> |
| </div> |
| <!-- class="header" --> |
| <div class="ind"><!-- End Header --><a id="CJADBDFD" name="CJADBDFD"></a><a id="TLDBW183" name="TLDBW183"></a> |
| <div class="sect1"><!-- infolevel="all" infotype="General" --> |
| <h1 class="sect1"><font face="arial, helvetica, sans-serif" color="#330099">Creating from an Overloaded PL/SQL Stored Procedure</font></h1> |
| <p>Starting in release 2.3, EclipseLInk DBWS can create a web service that exposes multiple PL/SQL stored procedures. Instead of specifying all the stored procedures within the DBWS builder file, you can specify a single procedure name and "overload" it with different parameters.</p> |
| <div align="center"> |
| <div class="inftblnote"><br /> |
| <table class="Note oac_no_warn" summary="" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td align="left"> |
| <p class="note"><img src="../../dcommon/images/note_icon.png" width="16" height="16" alt="Note" style="vertical-align:middle;padding-right:5px;" />Note:</p> |
| <p>This feature requires a database, such as Oracle, that supports overloading.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <br /></div> |
| <!-- class="inftblnote" --></div> |
| <a id="TLDBW184" name="TLDBW184"></a> |
| <div class="sect2"><a id="sthref58" name="sthref58"></a> |
| <h2 class="sect2"><font face="arial, helvetica, sans-serif" color="#330099">Example</font></h2> |
| <p>In this example, the stored procedure contains different parameters:</p> |
| <pre xml:space="preserve" class="oac_no_warn"> |
| CREATE PROCEDURE P(SIMPLARRAY IN TBL1, FOO IN VARCHAR2) AS |
| BEGIN |
| <em>-- 2 arguments SIMPLARRAY and FOO</em> |
| END P; |
| CREATE PROCEDURE P(SIMPLARRAY IN TBL1, FOO IN VARCHAR2, BAR IN VARCHAR2) AS |
| BEGIN |
| <em> -- (same name 'P') 3 arguments SIMPLARRAY, FOO and BAR</em> |
| END P; |
| |
| </pre> |
| <p>EclipseLink DBWS supports any combination of the <code>IN</code>, <code>OUT</code> and <code>IN OUT</code> arguments.</p> |
| <p>Type <strong>TBL1</strong> is defined in PL/SQL Package <code>SOMEPACKAGE</code> as follows:</p> |
| <pre xml:space="preserve" class="oac_no_warn"> |
| CREATE OR REPLACE PACKAGE SOMEPACKAGE AS |
| TYPE TBL1 IS TABLE OF VARCHAR2(111) INDEX BY BINARY_INTEGER; |
| PROCEDURE P(SIMPLARRAY IN TBL1, FOO IN VARCHAR2); |
| PROCEDURE P(SIMPLARRAY IN TBL1, FOO IN VARCHAR2, BAR IN VARCHAR2); |
| END SOMEPACKAGE; |
| |
| </pre> |
| <p>The <code>DBWSBuilder</code> utility requires a DBWS configuration file as input, as shown here:</p> |
| <pre xml:space="preserve" class="oac_no_warn"> |
| <?xml version="1.0" encoding="UTF-8"?> |
| <dbws-builder xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| <properties> |
| <property name="projectName">testOverloadedProcedure</property> |
| ... database properties |
| </properties> |
| <plsql-procedure |
| name="overloadedProcedure" |
| catalogPattern="SOMEPACKAGE" |
| procedurePattern="P" |
| /> |
| </dbws-builder> |
| |
| </pre> |
| <p>Use this command to execute the <code>DBWSBuilder</code>:</p> |
| <pre xml:space="preserve" class="oac_no_warn"> |
| prompt > dbwsbuilder.cmd -builderFile dbws-builder.xml -stageDir output_directory -packageAs wls testEcho.war |
| |
| </pre> |
| <p>where</p> |
| <ul> |
| <li> |
| <p><code>dbws-builder.xml</code> – The DBWS configuration file (as shown previously)</p> |
| </li> |
| <li> |
| <p><code>output_directory</code> – The output directory for the generated files</p> |
| </li> |
| <li> |
| <p><code>-packageAs</code> – Specifies the platform on which the web service will be deployed</p> |
| </li> |
| </ul> |
| <p>When generating queries and the WSDL in which overloaded procedures are used, a unique index identifies each procedure. The index starts at <strong>1</strong> and increments by one, for each overloaded procedure.</p> |
| <p>In this example, EclipseLink generates the following <code>eclipselink-dbws.wsdl</code> (Web Services Description Language):</p> |
| <pre xml:space="preserve" class="oac_no_warn"> |
| <wsdl:definitions |
| name="plsqloverloadService" |
| targetNamespace="urn:plsqloverloadService" |
| xmlns:ns1="urn:plsqloverload" |
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" |
| xmlns:tns="urn:plsqloverloadService" |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" |
| > |
| <wsdl:types> |
| <xsd:schema elementFormDefault="qualified" targetNamespace="urn:plsqloverloadService" xmlns:tns="urn:plsqloverloadService" |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| <xsd:import namespace="urn:plsqloverload" schemaLocation="eclipselink-dbws-schema.xsd"/> |
| <xsd:complexType name="p1ResponseType"> |
| <xsd:sequence> |
| <xsd:element name="result"> |
| <xsd:complexType><xsd:sequence><xsd:any/></xsd:sequence></xsd:complexType> |
| </xsd:element> |
| </xsd:sequence> |
| </xsd:complexType> |
| <xsd:complexType name="p1RequestType"> |
| <xsd:sequence> |
| <xsd:element name="SIMPLARRAY" type="ns1:SOMEPACKAGE_TBL1"/> |
| <xsd:element name="FOO" type="xsd:string"/> |
| </xsd:sequence> |
| </xsd:complexType> |
| <xsd:complexType name="p2ResponseType"> |
| <xsd:sequence> |
| <xsd:element name="result"> |
| <xsd:complexType><xsd:sequence><xsd:any/></xsd:sequence></xsd:complexType> |
| </xsd:element> |
| </xsd:sequence> |
| </xsd:complexType> |
| <xsd:complexType name="p2RequestType"> |
| <xsd:sequence> |
| <xsd:element name="SIMPLARRAY" type="ns1:SOMEPACKAGE_TBL1"/> |
| <xsd:element name="FOO" type="xsd:string"/> |
| <xsd:element name="BAR" type="xsd:string"/> |
| </xsd:sequence> |
| </xsd:complexType> |
| <xsd:element name="p2" type="tns:p2RequestType"/> |
| <xsd:element name="p1" type="tns:p1RequestType"/> |
| <xsd:element name="p1Response" type="tns:p1ResponseType"/> |
| <xsd:element name="p2Response" type="tns:p2ResponseType"/> |
| </xsd:schema> |
| </wsdl:types> |
| <wsdl:message name="p2Request"><wsdl:part name="p2Request" element="tns:p2"/></wsdl:message> |
| <wsdl:message name="p2Response"><wsdl:part name="p2Response" element="tns:p2Response"/></wsdl:message> |
| <wsdl:message name="p1Request"><wsdl:part name="p1Request" element="tns:p1"/></wsdl:message> |
| <wsdl:message name="p1Response"><wsdl:part name="p1Response" element="tns:p1Response"/></wsdl:message> |
| <wsdl:portType name="plsqloverloadService_Interface"> |
| <wsdl:operation name="p2"> |
| <wsdl:input message="tns:p2Request"/> |
| <wsdl:output message="tns:p2Response"/> |
| </wsdl:operation> |
| <wsdl:operation name="p1"> |
| <wsdl:input message="tns:p1Request"/> |
| <wsdl:output message="tns:p1Response"/> |
| </wsdl:operation> |
| </wsdl:portType> |
| <wsdl:binding name="plsqloverloadService_SOAP_HTTP" type="tns:plsqloverloadService_Interface"> |
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> |
| <wsdl:operation name="p2"> |
| <soap:operation soapAction="urn:plsqloverloadService:p2"/> |
| <wsdl:input><soap:body use="literal"/></wsdl:input> |
| <wsdl:output><soap:body use="literal"/></wsdl:output> |
| </wsdl:operation> |
| <wsdl:operation name="p1"> |
| <soap:operation soapAction="urn:plsqloverloadService:p1"/> |
| <wsdl:input><soap:body use="literal"/></wsdl:input> |
| <wsdl:output><soap:body use="literal"/></wsdl:output> |
| </wsdl:operation> |
| </wsdl:binding> |
| <wsdl:service name="plsqloverloadService"> |
| <wsdl:port name="plsqloverloadServicePort" binding="tns:plsqloverloadService_SOAP_HTTP"> |
| <soap:address location="REPLACE_WITH_ENDPOINT_ADDRESS"/> |
| </wsdl:port> |
| </wsdl:service> |
| </wsdl:definitions> |
| </pre></div> |
| <!-- class="sect2" --></div> |
| <!-- class="sect1" --></div> |
| <!-- class="ind" --> |
| <!-- Start Footer --> |
| <div class="footer"> |
| <hr /> |
| <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> |
| <col width="33%" /> |
| <col width="*" /> |
| <col width="33%" /> |
| <tr> |
| <td valign="bottom"> |
| <table class="navigation simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100" align="center"> |
| <col width="*" /> |
| <col width="48%" /> |
| <col width="48%" /> |
| <tr> |
| <td> </td> |
| <td align="center"><a href="creating_dbws_services008.htm"><img src="../../dcommon/images/larrow.png" alt="Previous" border="0" height="16" width="16" /></a></td> |
| <td align="center"><a href="advanced_methods.htm"><img src="../../dcommon/images/rarrow.png" alt="Next" border="0" height="16" width="16" /></a></td> |
| </tr> |
| </table> |
| </td> |
| <td align="center" width="34%"><a href="http://www.eclipse.org/eclipselink/" title="EclipseLink home"><img src="../../dcommon/images/ellogo.png" alt="EclipseLink" width="150" border="0" /></a><br /> |
| |
| |
| <td valign="bottom" align="right"> |
| <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="225"> |
| <tr> |
| <td> </td> |
| <td align="center" valign="top"><a href="toc.htm"><img src="../../dcommon/images/contents.png" alt="Go To Table Of Contents" border="0" height="16" width="16" /><br /> |
| <span class="mini">Contents</span></a></td><td> </td><td align="center"><a href="../../" target="_top" class="external text" title="Other searches" rel="nofollow"><img src="../../dcommon/images/search.png" alt="Search" style="border:0;" /><br /><span class="mini">Other Searches</span></a></td><td> </td><td align="center"><a href="../eclipselink_moxy.pdf" title="PDF" target="_blank"><img src="../../dcommon/images/pdf_icon.png" style="padding-right:5px;border:0" alt="PDF"><br /><span class="mini">PDF</span></a></td><td align="center"><a href="#disqus_thread" title="Comments""><img src="../../dcommon/images/comments.png" style="padding-right:5px;border:0" alt="Comments"><br /><span class="mini">Comments</span></a> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- class="footer" --> |
| <div id="copyright">Copyright © 2014 by The Eclipse Foundation under the <a href="http://www.eclipse.org/org/documents/epl-v10.php">Eclipse Public License (EPL)</a><br /> <script type="text/javascript">var LastUpdated = document.lastModified;document.writeln ("Updated: " + LastUpdated);</script> </div><!-- START: Analytics --><script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1608008-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script><!-- END: Analytics --><!-- START: Sharethis --><script>var options={ "publisher": "e2fe9e07-fab6-4f84-83ea-0991b429842c", "position": "right", "ad": { "visible": false, "openDelay": 5, "closeDelay": 0}};var st_hover_widget = new sharethis.widgets.hoverbuttons(options);</script><!-- END: Sharethis --><!-- START: Disqus --><div id="disqus_thread"></div> <script type="text/javascript"> var disqus_developer = 1;var disqus_shortname = 'eclipselinkdoc'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">Comments powered by <span class="logo-disqus">Disqus</span></a><!-- END: Disqus --></body> |
| </html> |