<?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 res any;
  declare err varchar;

  err := '';

  if ({?'sc'} = '1')
    {
      declare exit handler for sqlstate '*' { err := concat (__SQL_STATE, ' ', __SQL_MESSAGE); };
      {
        res := soap_call (sprintf ('localhost:%s', server_http_port ()),
	       '/services', null, 'SOAPTEST', vector('par', 'OK'), 1);
        err := 'OK.';
      }
    }
?>

<html>
<head><link rel="stylesheet" type="text/css" href="../demo.css"></head>
<body>
<H3>SOAP service test page</H3>
<?vsp
   if (atoi (cfg_item_value (virtuoso_ini_path(), 'HTTPServer', 'ServerThreads')) < 2)
     {
       http ('<H3>This example needs at least 2 HTTP server threads configured.</H3>');
     }
   if ({?'sc'} = '1' and err <> '')
     {
?>
<p>Connection status: <?=err?></p>
<?vsp
     }
?>
<p><a href="so_s_1_sample_1.vsp?sc=1">Click here to test the installed SOAP service.</a></p>
</body>
</html>
