Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\tutorial\web_serv.htm
<!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> <!-- Run date = February 23, 2005 16:58:38 --> <meta name="Generator" content=" Oracle DARB XHTML converter - Version 4.1.3 Build 116" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title> How to Implement a Web Service</title> <link rel="stylesheet" type="text/css" href="blafdoc.css" title="default" /> <link rel="stylesheet" type="text/css" href="darbbook.css" title="default" /> <link rel="prev" href="check_box.htm" title="Previous" /> <link rel="next" href="bar_chart.htm" title="Next" /> <link rel="up" href="toc.htm" title="Up" /> <link rel="contents" href="toc.htm" title="Contents" /> <link rel="copyright" href="./support/html/cpyr.htm" title="Copyright" /> <link rel="index" href="index.htm" title="Index" /> </head> <body> <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"> <b>Oracle® HTML DB Guide to Building Applications </b> <br /> <b>Release 2.0 </b> </td> <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="./support/gifs/toc.gif" alt="Go To Table Of Contents" border="0" /><br /><span class="icon">Contents</span></a></td> </table> </td> </tr> </table> <hr /> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100"> <tr> <td align="center"> <a href="check_box.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="bar_chart.htm"> <img src="./support/gifs/rightnav.gif" alt="Next" border="0" /><br /><span class="icon">Next</span></a> </td> <td> </td> </tr> </table> </div><!-- class="header" --> <div class="IND"> <!-- End Header --><a id="CHDJEFEB" name="CHDJEFEB"></a><a id="sthref131" name="sthref131"></a> <h1><a name="HTMAD006"></a>How to Implement a Web Service</h1> <p>Web services enable applications to interact with one another over the Web in a platform-neutral, language independent environment. In a typical Web services scenario, a business application sends a request to a service at a given URL by using the HTTP protocol. The service receives the request, processes it, and returns a response. You can incorporate calls to external Web services in applications developed in Oracle HTML DB. </p> <p>Web services in Oracle HTML DB are based on SOAP (the Simple Object Access Protocol). SOAP is a World Wide Web Consortium (W3C) standard protocol for sending and receiving requests and responses across the Internet. SOAP messages can be sent back and forth between a service provider and a service user in SOAP envelopes. </p> <p>This tutorial illustrates how to call a Web service from within an Oracle HTML DB application. </p> <p class="subhead2">Topics:</p> <ul> <li type="disc"> <p><a href="#CHDEJBGJ">About Creating Web Service References</a> </p> </li> <li type="disc"> <p><a href="#CACGGHAG">Creating a New Application</a> </p> </li> <li type="disc"> <p><a href="#CACCFEID">Specifying an Application Proxy Server Address</a> </p> </li> <li type="disc"> <p><a href="#CACIJADB">Searching a UDDI Registry for a Business Name</a> </p> </li> <li type="disc"> <p><a href="#CACCAFDF">Searching a UDDI Registry for a Service Name</a> </p> </li> </ul> <div align="center"> <div class="inftblNote"> <br /><table class = "Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">Note:</p>The SOAP 1.1 specification is a W3C note. (The W3C XML Protocol Working Group has been formed to create a standard that will supersede SOAP.) <p>For more information on Simple Object Access Protocol (SOAP) 1.1 see: </p> <pre xml:space="preserve" class="oac_no_warn"><a href="http://www.w3.org/TR/SOAP/">http://www.w3.org/TR/SOAP/</a> </pre> </td> </tr> </tbody> </table><br /> </div><!-- class="inftblNote --> </div><a id="CHDEJBGJ" name="CHDEJBGJ"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref132" name="sthref132"></a> <h2>About Creating Web Service References </h2> <p>To utilize Web services in Oracle HTML DB, you create a Web service reference using a wizard. Each Web service reference is based on a Web Services Description Language (WSDL) document that describes the target Web service. When you create a Web service reference, the wizard analyzes the WSDL and collects all the necessary information to create a valid SOAP message. </p> <p>When you create a Web service reference you need to decide how to locate the WSDL. You can locate a WSDL two ways: </p> <ul> <li type="disc"> <p>By searching a UDDI registry for either a service name or business name. </p> <p> A Universal Description, Discovery, and Integration (UDDI) registry is a directory where businesses register their Web services. </p> </li> <li type="disc"> <p>By entering the URL to the WSDL document. </p> </li> </ul> <p>In this tutorial you will create Web service references by searching a UDDI registry. </p> </div><!-- class="sect1" --> <a id="CACGGHAG" name="CACGGHAG"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref133" name="sthref133"></a> <h2>Creating a New Application </h2> <p>First, create a new application. </p> <p>To create an application: </p> <ol type="1" start="1"> <li> <p>From the Application Builder home page, click <span class="bold">Create Application</span>. </p> </li> <li> <p>On Select Creation Method, select <span class="bold">From Scratch</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Create Application: </p> </li> <li> <ol type="a"> <li> <p>For Name, enter <code>Web Services</code>. </p> </li> <li> <p>From Pages, select <span class="bold">1</span>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Tabs, accept the default <span class="bold">One Level of Tabs</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Page Names, enter <code>Web Services</code> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Page Tab Name, enter <code>Web Services</code> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Theme, select Theme 2 and click <span class="bold">Next</span>. </p> </li> <li> <p>Review your selections and click <span class="bold">Create Application</span>. </p> </li> </ol> <p>The Application Builder home page appears. </p> </div><!-- class="sect1" --> <a id="CACCFEID" name="CACCFEID"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref134" name="sthref134"></a> <h2>Specifying an Application Proxy Server Address </h2> <p>If your environment requires a proxy server to access the Internet, you must specify a proxy server address on the Application Attributes page before you can create a Web service reference. </p> <p>To specify a proxy address for an application: </p> <ol type="1" start="1"> <li> <p>On the Application Builder home page, click <span class="bold">Edit Attributes</span>. </p> </li> <li> <p>Under Application Definition, enter the proxy server in Proxy Server. </p> </li> <li> <p>Click <span class="bold">Apply Changes</span>. </p> </li> </ol> </div><!-- class="sect1" --> <a id="CACIJADB" name="CACIJADB"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref135" name="sthref135"></a> <h2>Searching a UDDI Registry for a Business Name </h2> <p>In this exercise you create a form which displays stock quotes based on a stock symbol you provide. You will create a Web service reference by searching the UDDI registry for a business name: </p> <p>To create a Web service reference by search for a business name: </p> <ol type="1" start="1"> <li> <p>Navigate to the Application Builder home page. </p> </li> <li> <p>Click <span class="bold">Shared Components</span>. </p> </li> <li> <p>Under Logic, select <span class="bold">Web Service References</span>. </p> <p>The Web Service References page appears. </p> </li> <li> <p>Click <span class="bold">Create</span>. </p> </li> <li> <p>When prompted whether to search a UDDI registry to find a WSDL, select <span class="bold">Yes</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For UDDI Location, select <span class="bold">IBM UDDI</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Search for Services: </p> <ol type="a"> <li> <p>For Search Type, select <span class="bold">Business Name</span>. </p> </li> <li> <p>In Name, enter: </p> <pre xml:space="preserve" class="oac_no_warn">%xMethods% </pre> </li> <li> <p>Click <span class="bold">Search</span>. </p> </li> <li> <p>Under Matching Services, select <span class="bold">xMethods Delayed Stock Quotes</span>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> <p>A summary page appears describing the selected Web service. </p> </li> <li> <p>Review your selection and click <span class="bold">Next</span> to continue. </p> <p>The URL to the WSDL document displays in the WSDL Location field. </p> </li> <li> <p>Click <span class="bold">Finish</span>. </p> </li> </ol> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref136" name="sthref136"></a> <h3>Create a Form to Display a Stock Quote </h3> <p>Next, you will create a form to display a stock quote based on the stock symbol you provide. </p> <p>To create a form after creating a Web Service Reference: </p> <ol type="1" start="1"> <li> <p>On Web Service Reference Added page, select <span class="bold">Create Form on Web Service</span>. </p> </li> <li> <p>On Web Service Reference and Operation: </p> <ol type="a"> <li> <p>For Web Service Reference, select <span class="bold">XMethods Delayed Stock Quotes</span>. </p> </li> <li> <p>For Operation, select <span class="bold">getQuote</span>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Identify Page and Region Attributes accept the defaults and click <span class="bold">Next</span>. </p> <ol type="a"> <li> <p>In Region Title, enter <code>Get Stock Quote</code>. </p> </li> <li> <p>Accept the other defaults. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Items for Input Parameters, accept the defaults and click <span class="bold">Next</span>. </p> </li> <li> <p>For Items for Output Parameters: </p> <ol type="a"> <li> <p>For Item Label, enter <code>Stock Price</code>. </p> </li> <li> <p>Accept the other defaults. </p> </li> <li> <p>Click <span class="bold">Finish</span>. </p> </li> </ol> </li> <li> <p>Click <span class="bold">Run Page</span> to view the form. </p> </li> <li> <p>On the Log in page, enter the User Name and Password for your workspace and click <span class="bold">Login</span>. </p> <p>A form resembling <a href="#CACBBGEE">Figure 6-1</a> appears. </p> <div class="figure"> <a id="CACBBGEE" name="CACBBGEE"></a><a id="sthref137" name="sthref137"></a> <p class="titleinfigure">Figure 6-1 Get Stock Quote Form</p> <img src="./img/web_stock.gif" alt="Description of web_stock.gif follows" title="Description of web_stock.gif follows"/> <br /><a id="sthref138" name="sthref138" href="./img_text/web_stock.htm">Description of the illustration web_stock.gif</a> <br /><br /> </div><!-- class="figure" --> </li> <li> <p>Test the form. In Symbol, enter a stock symbol (such as <code>ORCL</code>) and click <span class="bold">Submit</span>. </p> <p>The associated stock price displays in the Stock Price field. </p> </li> <li> <p>Select <span class="bold">Edit Application</span> from the Developer toolbar to return to the Application Builder home page. </p> </li> </ol> </div><!-- class="sect2" --> </div><!-- class="sect1" --> <a id="CACCAFDF" name="CACCAFDF"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref139" name="sthref139"></a> <h2>Searching a UDDI Registry for a Service Name </h2> <p>Next, you will create a form that displays market futures. In this exercise you will create a Web service reference by search a UDDI registry for a service name. Then, you will create a form and report. </p> <p>To create a new Web service by searching for a service name: </p> <ol type="1" start="1"> <li> <p>Navigate to the Application Builder home page. </p> </li> <li> <p>Click <span class="bold">Shared Components</span>. </p> <p>The Shared Components page appears. </p> </li> <li> <p>Under Logic, select <span class="bold">Web Service References</span>. </p> <p>The Web Service References page appears. </p> </li> <li> <p>Click <span class="bold">Create</span>. </p> </li> <li> <p>When prompted whether to search a UDDI registry to find a WSDL, select <span class="bold">Yes</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For UDDI Location, select <span class="bold">XMethods UDDI</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Search for Services: </p> <ol type="a"> <li> <p>For Search Type, select <span class="bold">Service Name</span>. </p> </li> <li> <p>In Name, enter <code>xignite</code> and click <span class="bold">Search</span>. </p> <p>This is a search engine for market news. </p> </li> <li> <p>Under Matching Services, select <code>XigniteFutures</code>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> <p>A summary page appears describing the selected Web service. </p> </li> <li> <p>Review your selection and click <span class="bold">Next</span> to continue. </p> <p>The WSDL Location field displays the URL to the WSDL document. </p> </li> <li> <p>Click <span class="bold">Finish</span>. </p> </li> </ol> <p>The Web service reference, XigniteFutures, is added to the Web Service References Repository. </p> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref140" name="sthref140"></a> <h3>Create a Form and Report </h3> <p>Next, you need to create a page that contains a form and report. </p> <p>To create a form and report after creating a Web Service Reference: </p> <ol type="1" start="1"> <li> <p>On Web Service Reference Added page, select <span class="bold">Create Form and Report on Web Service</span>. </p> </li> <li> <p>On Web Service Reference and Operation: </p> <ol type="a"> <li> <p>For Web Service Reference, select <span class="bold">XigniteFutures</span>. </p> </li> <li> <p>For Operation, select <span class="bold">ListFuturesByExchange</span>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Identify Page and Region Attributes: </p> <ol type="a"> <li> <p>Change Form Region Title to <code>List Futures By Exchange</code>. </p> </li> <li> <p>Accept the other defaults and click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Items for Input Parameters: </p> <ol type="a"> <li> <p>For P2_USERNAME, P2_PASSWORD, P2_TRACER, select <span class="bold">No</span> in the Create column. </p> </li> <li> <p>For P2_EXCHANGE, accept the default <span class="bold">Yes</span> in the Create column. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Base Node: </p> <ol type="a"> <li> <p>For Temporary Result Set Name (Collection), accept the default. </p> </li> <li> <p>Result Tree to Report On, select <span class="bold">Future (tns:Future)</span>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Result Parameters to Display, select all the parameters and click <span class="bold">Finish</span>. </p> </li> <li> <p>Click <span class="bold">Run Page</span> to view the form. </p> </li> <li> <p>If a Log in page appears, enter the User Name and Password for your workspace and click <span class="bold">Login</span>. </p> <p>A form and report resembling <a href="#CACFJFIH">Figure 6-2</a> appears. Notice that the List Futures by Exchange Form on the top of the page contains a data entry field and a submit button, but the Results Report does not contain any data. </p> <div class="figure"> <a id="CACFJFIH" name="CACFJFIH"></a><a id="sthref141" name="sthref141"></a> <p class="titleinfigure">Figure 6-2 List Futures by Exchange Form and Report without Data</p> <img src="./img/web_name.gif" alt="Description of web_name.gif follows" title="Description of web_name.gif follows"/> <br /><a id="sthref142" name="sthref142" href="./img_text/web_name.htm">Description of the illustration web_name.gif</a> <br /><br /> </div><!-- class="figure" --> </li> <li> <p>Test the form. In Exchange, enter <code>NYMEX</code> and click <span class="bold">Submit</span>. </p> <p>The report at the bottom of the page should resemble <a href="#CACJEFFB">Figure 6-3</a>. The report lists the symbol, name, month, and year of futures from the New York Mercantile Exchange (NYMEX). </p> <div class="figure"> <a id="CACJEFFB" name="CACJEFFB"></a><a id="sthref143" name="sthref143"></a> <p class="titleinfigure">Figure 6-3 List Futures by Exchange Form and Report with Data</p> <img src="./img/web_name_2.gif" alt="Description of web_name_2.gif follows" title="Description of web_name_2.gif follows"/> <br /><a id="sthref144" name="sthref144" href="./img_text/web_name_2.htm">Description of the illustration web_name_2.gif</a> <br /><br /> </div><!-- class="figure" --> </li> </ol> </div><!-- class="sect2" --> </div><!-- class="sect1" --> </div> <!-- Start Footer --> <div class="footer"> <hr /> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <tr> <td valign="bottom" width="33%"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100"> <tr><td> </td> <td align="center"> <a href="check_box.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="bar_chart.htm"> <img src="./support/gifs/rightnav.gif" alt="Next" border="0" /><br /><span class="icon">Next</span></a> </td> </tr> </table> </td> <td class="copyrightlogo"> <a href="./support/html/cpyr.htm"> <span class="copyrightlogo"> Copyright © 2005, Oracle. All rights reserved. </span> </a> </td> <td valign="bottom" align="right" width="33%"> <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="./support/gifs/toc.gif" alt="Go To Table Of Contents" border="0" /><br /><span class="icon">Contents</span></a></td> </table> </td> </tr> </table> </div><!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de