<?vsp 
--  
--  $Id$
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2018 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, sel varchar;
   declare me varchar;
   me := http_path();
   r := ''; sel := '';
   if ({?'exec'} = 'Get data')
   {
     -- When hosted in dav we set the 'Content' value to empty, because string_session will crate problems
     for (declare i int,i:=0;i<length(params);i:=i+2)
       if (params[i] = 'Content')
         params[i+1] := '';
   declare exit handler for sqlstate '*' { r := __SQL_MESSAGE; goto endf; };
   {
     result := soap_call (sprintf ('localhost:%s', server_http_port ()), '/SOAP_SO_S_14/', null, 'ms_remote', params, 11);
   }
   declare exit handler for sqlstate '*' { r := '** no result returned **'; goto endf; };
   {
     r := result[1][1];
     http (r);
     http_xslt (TUTORIAL_XSL_DIR () || '/tutorial/services/so_s_14/ms.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');
?>
<form method="post" action="<?=me?>">
<table class="tableentry">
<tr><td>1. Enter a search string</td><td>
     <input type="text" name="mask" size="15" value="AN%"/><small>'%' wildcard</small> </td></tr>
<tr><td>2. Enter a DSN</td><td>
     <input type="text" name="dsn" size="15" value="mssql"/></td></tr>
<tr><td>3. Enter a UID</td><td>
     <input type="text" name="uid" size="15" value="demo"/></td></tr>
<tr><td>4. Enter a PWD</td><td>
     <input type="password" name="pwd" size="15" value="demo"/></td></tr>
<tr><td>5. Call the ms_remote</td><td><input type="submit" name="exec" value="Get data"></td></tr>
</table>
</form>

</body>
</html>

