<?vsp 
--  
--  $Id$
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2024 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); };
      {
	declare xt any;
        res := soap_call (sprintf ('localhost:%s', server_http_port ()),
	       '/services', null, 'BIF_HELLO_WORLD', vector(), 1);
        xt := xml_tree_doc (res);
        dbg_obj_print (xt);
        err := xpath_eval ('//CallReturn', xt, 1);
      }
    }
?>

<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>Service return: <b><?=err?></b></p>
<?vsp
     }
?>
<p><a href="so_s_22_sample.vsp?sc=1">Click here to test the C function exposed as SOAP service.</a></p>
</body>
</html>
