<?vsp 
--  
--  $Id: ExtensibilityRequired.vsp,v 1.2.2.1 2012/03/08 12:55:14 source Exp $
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2012 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 := '00000'; msg := 'OK; The extensibility element with wsdl:required rejected.'; goto end_t; };
      modu := soap_wsdl_import ({?'wsdl'}, 1, 1, 1);
      }
      declare exit handler for sqlstate '*' { stat := __SQL_STATE; msg := __SQL_MESSAGE; goto end_t; };
      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:
    if (step = 1 and msg = 'OK')
      msg := 'The WSDL file do not contains extensibility elements with wsdl:required.';


?>

<HTML>
  <HEAD>
    <TITLE>InteropTestExtensibility</TITLE>
    <LINK rel="stylesheet" type="text/css" href="../demo.css">
  </HEAD>
<BODY>
    <H3>Interop Test Extensibility Required</H3>
    <P>Same as InteropTestExtensibility, but with wsdl:required attribute on the ext:binding element. According to the spec, Toolkit should reject such wsdl.
    </P>
  <FORM method="POST" action="ExtensibilityRequired.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/InteropTestExtensibilityRequired.wsdl" size="60%"></TD>
  </TR>
  <TR>
     <TD>&nbsp;</TD>
     <TD><input type="submit" name="Execute" value="Execute" ></TD>
  </TR>
</TABLE>
<?vsp
  if (step = 1)
    {
?>
    <P><H2>Return value:</H2>
    <TABLE border="0" class="tableresult">

     <TR><TD>Result</TD><TD><b><?=msg?></b></TD></TR>

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

