I have started working with Web Services and trying to consume one for telephony provided by Avaya from a web application that I am creating in Netbeans. The code in the application is simply for a login:
HTML code
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Inicio Sesión</title>
</head>
<body>
<form id="login-form" class="login-form" action="index_proceso.jsp" method="post" autocomplete="off">
<div>
<input type="text" placeholder="Usuario" id="usuario" required name="usuario" autocomplete="off" >
</div>
<div>
<input type="password" class="user-password" placeholder="Contraseña"required name="contrasena" autocomplete="off" >
</div>
<input id="login-submit" type="submit" class="submit" value="Ingresar"/>
</form>
</body>
Java code from a JSP
These are the actions that will be carried out when you press the button for the login. This is where I send to call the "createSession" method provided by the Web Service that I am trying to consume, this method returns a token or string type identifier if the user's data (username and password) are correct. So the only thing I'm asking now is for you to return and print that token.
<jsp:useBean id="valida" scope="request" class="control.Control" />
<%
String usuario = request.getParameter("usuario");
String contrasena = request.getParameter("contrasena");
System.out.println("DATOS: " + usuario + " " + contrasena);
String resultado = "";
try{
resultado = valida.createSession(usuario,contrasena);
}catch(Exception ex){
System.out.println(ex.getMessage());
}
System.out.println("TOKEN " + resultado);
%>
Java class where the createSession method is imported
package control;
import webservices.GenericException;
import webservices.InvalidCredentialsException;
public class Control {
public static String createSession(java.lang.String loginName, java.lang.String password) throws InvalidCredentialsException, GenericException {
webservices.Directory_Service service = new webservices.Directory_Service();
webservices.Directory port = service.getDirectory();
return port.createSession(loginName, password);
}
}
The problem I have is that pressing the Enter button sends me the following error.
Failed to access the WSDL at: link . It failed with: java.security.cert.CertificateException: No subject alternative names present.
I've been investigating how to solve that error but I have not succeeded. I do not know if this error is due to some certificate or because I am doing badly the consumption of the web service. The functions and classes were downloaded correctly but when trying to use them I get the error mentioned above.
I hope you can help me understand the cause of this error and how to solve it.