Olá,
Criei um aplicativo simples Em Java SE para consumir os serviços de um webservice do Protheus (Microsiga), com SSL, certificado criado pelo OpenSSL.
Está ocorrendo o seguinte erro:
erro ao tentar realizar o login: Cannot find ‘https://192.168.2.122/ws/USERPORTAL.apw?WSDL’ wsdl. Place the resource correctly in the classpath.
- Usando Netbeans 7.1, criei um projeto simples de um aplicativo Java SE, para exemplificar o erro;
- Adicionei um cliente para serviço web, baseando-me na url do WSDL ( http://192.168.2.122/ws/USERPORTAL.apw?WSDL );
- Na classe principal, adicionei a chamada ao método de login deste servilo USERPORTAL;
- Fiz as devidas alterações na classe principal para chamar tal método e reproduzir o problema, conforme segue:
package teste;
import br.com.microsiga.webservices.userportal.LOGINUSERSTRUCT;
/**
*
* @author vicente
*/
public class Teste {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String mensagem;
try {
LOGINUSERSTRUCT result = prtlogin("teste", "teste", "1", "");
System.out.println(result.getUSERCODE());
} catch (Exception ex) {
mensagem = ex.getMessage();
System.out.println(" erro ao tentar realizar o login: " + mensagem);
}
}
private static LOGINUSERSTRUCT prtlogin(java.lang.String userlogin, java.lang.String userpassword, java.lang.String usertype, java.lang.String portalaccess) {
br.com.microsiga.webservices.userportal.USERPORTAL service = new br.com.microsiga.webservices.userportal.USERPORTAL();
br.com.microsiga.webservices.userportal.USERPORTALSOAP port = service.getUSERPORTALSOAP();
return port.prtlogin(userlogin, userpassword, usertype, portalaccess);
}
}
Este mesmo serviço acessado via http não dá problema. Já via https ocorre a bronca acima.