<?vsp 
--  
--  $Id: so_s_8_client.vsp,v 1.3 2006/08/15 19:30:34 source Exp $
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2006 OpenLink Software
--  
--  This project is free software; you can redistribute it and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation; only version 2 of the License, dated June 1991.
--  
--  This program is distributed in the hope that it will be useful, but
--  WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
--  General Public License for more details.
--  
--  You should have received a copy of the GNU General Public License along
--  with this program; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--  
--  

   declare result, ses, r, sym varchar;
   r := '';
   if ({?'exec'} = 'Get data')
   {
     -- When hosted in dav we set the 'Content' value to empty, because string_session will crate problems
     declare _params any;
     _params := vector();
     for (declare i int,i:=0;i<length(params);i:=i+2)
       if (params[i] <> 'Content')
         _params := vector_concat(_params,vector(params[i],params[i+1]));
     params := _params;
   declare exit handler for sqlstate '*' { r := __SQL_MESSAGE; goto endf; };
   {
     result := soap_call (sprintf ('localhost:%s', server_http_port ()), '/DAV/so_s_8/so_s_8_server.vsp', null, 'get_NasdaqQuotes', params, 11);
   }
   declare exit handler for sqlstate '*' { r := '** no result returned **'; goto endf; };
   {
     r := result[1][1];
     http (r);
     http_xslt ('virt://WS.WS.SYS_DAV_RES.RES_FULL_PATH.RES_CONTENT:/DAV/so_s_8/sr.xsl', params);
     return 0;
   }
   }
endf:
?>
<html>
<HEAD><link rel="stylesheet" type="text/css" href="demo.css" /></HEAD>
<body>
<H3>SOAP client</H3>
<?vsp
  if (r <> '')
    http_value (r,'pre');
  sym := get_keyword ('symbol', params, 'MSFT,ORCL');
?>
<form method="post" action="so_s_8_client.vsp">
<input type="hidden" name="url" value="http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=">
<table class="tableentry">
<tr><td>1. Enter a symbol to get the stock quotes report</td><td>
<input type="text" name="symbol" size="15" value="<?=sym?>" />
</td></tr>
<tr><td>2. Call the get_NasdaqQuotes_8</td><td><input type="submit" name="exec" value="Get data"></td></tr>
</table>
</form>

</body>
</html>

