<!DOCTYPE html>
<%--
   Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
--%>

<%
 String address = request.getRequestURL().toString();
 if (address.endsWith(".jsp")) {
    address = address.substring(0, address.lastIndexOf("/"));
 }
 if (!address.endsWith("/")) {
    address += "/";
 }
 if (address.toLowerCase().startsWith("https://")) {
    address += "wssunt";
 } else {
    address += "wssunt-http";
 }

 
%>
<html>
    <head>
        <title>Test web services call using WSS-UNT</title>
        <script lang="javascript">
          function selectcsf(val) {
          
              if (val.checked) {
                  document.getElementsByName("user")[0].disabled = true;
                  document.getElementsByName("pwd")[0].disabled = true;
                  document.getElementsByName("csfkey")[0].disabled = false;
              }
              else {
                  document.getElementsByName("user")[0].disabled = false;
                  document.getElementsByName("pwd")[0].disabled = false;
                  document.getElementsByName("csfkey")[0].disabled = true;
              }
          }
        </script>
    </head>
    <body>
        <form name="test" method="post" action="testws">
            <table>
                <tr>
                    <th>WSDL</th>
                    <td>
                        <input name="wsdl" type="text" size="120" value="<%=address%>?wsdl"></input>
                    </td>
                </tr>
                 
                <tr>
                    <th>Address</th>
                    <td>
                        <input name="address" type="text" size="110" value="<%=address%>"></input>
                    </td>
                </tr>
                 
                <tr>
                    <th>Use csf-key</th>
                    <td>
                        <input name="usecsfkey" onchange="javascript:selectcsf(this)" value="true"
                               title="Check this if you want to use csf-key (Oracle Credential Store Framework) instead of user name and pwd."
                               type="checkbox" ></input>
                                <input name="csfkey"
                               title="You can create a credential against a key using javacloud.jar set-credential command and you can specify the key here."
                               type="text" size="15" value=""></input>
                    </td>
                </tr>
                 
               
                 
                <tr>
                    <th>User</th>
                    <td>
                        <input name="user" title="Only the user name.Please do not prefix with identity doamin."
                               type="text" size="40" value="user"></input>
                    </td>
                </tr>
                 
                <tr>
                    <th>Password</th>
                    <td>
                        <input name="pwd" type="password" size="20" value=""></input>
                    </td>
                </tr>
                 
                <tr>
                    <th>Name</th>
                    <td>
                        <input name="name" type="text" size="20" value="Name"></input>
                    </td>
                </tr>
                 
                <tr>
                    <th>===&gt;Test</th>
                    <td>
                        <input name="submit" type="submit" size="20" value="Click to test"></input>
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>
