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 / getquote3.xsp < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.8 KB  |  79 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: getquote3.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 3</title>
  31.  
  32.     <content>
  33.  
  34.       <xsp:logic>
  35.         String symbol = request.getParameter("symbol");
  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>This is yet another example of the XScript and SOAP
  42.            logicsheets. This sample is very similar with
  43.            <code>soap-getquote2.xsp</code>, except that the stylesheet is
  44.            defined in an external file.
  45.            </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>
  54.             The stock price for <xsp:expr>symbol</xsp:expr> is 
  55.  
  56.             <xscript:variable name="soap-result">
  57.               <soap:call url="http://services.xmethods.net:80/soap">
  58.                 <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes">
  59.                   <soap:enc/>
  60.                   <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>
  61.                 </ns1:getQuote>
  62.               </soap:call>
  63.             </xscript:variable>
  64.  
  65.             <xscript:variable name="stylesheet"
  66.                               href="stylesheets/soap-getquote3.xsl"/>
  67.  
  68.             <xscript:transform name="soap-result" stylesheet="stylesheet"/>
  69.           </para>
  70.  
  71.           <form href="soap-getquote">
  72.             <input value="Back" type="submit"/>
  73.           </form>
  74.         }
  75.       </xsp:logic>
  76.     </content>
  77.   </page>
  78. </xsp:page>
  79.