home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / getquote1.xsp < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.6 KB  |  71 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <!--
  19.   Author: Ovidiu Predescu "ovidiu@cup.hp.com"
  20.   Date: October 9, 2001
  21.   CVS $Id: getquote1.xsp,v 1.2 2004/04/05 12:25:33 antonio Exp $
  22.  -->
  23.  
  24. <xsp:page language="java"
  25.           xmlns:xsp="http://apache.org/xsp"
  26.           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  27.           xmlns:xscript="http://apache.org/xsp/xscript/1.0"
  28.           xmlns:soap="http://apache.org/xsp/soap/3.0">
  29.   <page>
  30.     <title>SOAP Stock Quote Example 1</title>
  31.  
  32.     <content>
  33.       <xsp:logic>
  34.         String symbol = request.getParameter("symbol");
  35.  
  36.         if (symbol == null || symbol.equals("")) {
  37.            <para>This page demonstrates the SOAP logicsheet for
  38.            Cocoon2. It accesses a SOAP service that provides stock quotes
  39.            and displays the result.</para>
  40.  
  41.            <para>The SOAP result is placed in the generated page, and the
  42.            stock price is extracted from it using an external XSLT
  43.            stylesheet. Compare this approach with the one used in
  44.            <code>soap-getquote2.xsp</code>, which uses an internal XScript
  45.            stylesheet to extract the stock price.</para>
  46.  
  47.            <para>Please enter the stock ticker: </para>
  48.            <form href="soap-getquote">
  49.              <input name="symbol" type="text" value="HPQ"/>
  50.              <input value="Do it!" type="submit"/>
  51.            </form>
  52.         } else {
  53.           <para>The stock price for <xsp:expr>symbol</xsp:expr> is 
  54.  
  55.             <soap:call url="http://services.xmethods.net:80/soap">
  56.               <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
  57.                 <soap:enc/>
  58.                 <symbol xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><xsp-request:get-parameter name="symbol"/></symbol>
  59.               </ns1:getQuote>
  60.             </soap:call>
  61.           </para>
  62.  
  63.           <form href="soap-getquote">
  64.             <input value="Back" type="submit"/>
  65.           </form>
  66.         }
  67.       </xsp:logic>
  68.     </content>
  69.   </page>
  70. </xsp:page>
  71.