<?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 result any;
declare str, req, resp varchar;
declare stat, msg, modu varchar;
declare step varchar;
  step := 0;
  stat := ''; msg := 'OK'; str := ''; req := ''; resp := '';
  if ({?'Execute'} is not null and length ({?'wsdl'}) > 0)
    {
      step := 1;
      declare exit handler for sqlstate '*' { stat := __SQL_STATE; msg := __SQL_MESSAGE; goto end_t; };
      modu := soap_wsdl_import ({?'wsdl'}, 1, 1, 1);
      if (length (modu) > 1)
        {
	  declare mname, proc varchar;
	  declare pind integer;
          mname := modu [0];
          pind := position ('echoString', modu);
          if (pind)
	    {
              result := call (concat (mname,'.echoString')) ('This is a test');
              str := soap_box_xml_entity_validating (result[0], 'string');
              req := result[1];
              resp := result[2];
	    }
	  else
	    msg := 'The operation echoString can''t be found';
	}
    }
end_t:

?>

<HTML>
  <HEAD>
    <TITLE>InteropTestExtensibility</TITLE>
    <LINK rel="stylesheet" type="text/css" href="../demo.css">
  </HEAD>
<BODY>
    <H3>Interop Test Extensibility</H3>
    <P>A Document/literal mode Version has one operation echoString with extensibility elements everywhere they are allowed (not required).</P>
  <FORM method="POST" action="Extensibility.vsp">
<TABLE CLASS="tableentry" BORDER="0">

  <TR>
     <TD>Enter a WSDL URL</TD>
     <TD><input type="text" name="wsdl" value="http://www.whitemesa.com/r3/InteropTestExtensibility.wsdl" size="60%"></TD>
  </TR>
  <TR>
     <TD>&nbsp;</TD>
     <TD><input type="submit" name="Execute" value="Execute" ></TD>
  </TR>
</TABLE>
<?vsp
  if (step = 1 and msg = 'OK')
    {
?>
    <P><H2>Return value:</H2>
    <TABLE border="0" class="tableresult">

     <TR><TD>Return value:</TD><TD><b><?=str?></b></TD></TR>

    <tr><td colspan="2">Request message buffer:</td></tr>
    <tr><td colspan="2">
    <TEXTAREA name=buffer_request rows=15 cols=80><?=req?></TEXTAREA>
    </TD></TR>
    <tr><td colspan="2">Response message buffer:</td></tr>
    </TD></TR>
    <tr><td colspan="2">
    <TEXTAREA name=buffer_response rows=15 cols=80><?=resp?></TEXTAREA>
    </TD></TR>
     </TABLE>
<?vsp
    }
  else if (step = 1 and msg <> 'OK')
    {
?>
    <TABLE border="0" class="tableresult">

     <TR><TD>Error:</TD><TD><b><?=msg?></b></TD></TR>

     </TABLE>
<?vsp
    }
?>
  </FORM>
</BODY>
