I have a web service client which has been used several months, but last days we are getting an error when we execute the invocation to the method.
The error we get is :
[22 mar 2018 09:17:38,828] ERROR com.nisa.sms.EnviarSMS - (EnviarSMS.java:51) - Error al enviar el sms: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
the method is called with axis and this is the code :
public void enviarMensaje(int hospital, java.lang.String telefono, java.lang.String mensaje, javax.xml.rpc.holders.StringHolder respuesta, javax.xml.rpc.holders.StringHolder error) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://webservices.nisa.com/", "enviarMensaje"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Integer(hospital), telefono, mensaje});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
java.util.Map _output;
_output = _call.getOutputParams();
try {
respuesta.value = (java.lang.String) _output.get(new javax.xml.namespace.QName("", "respuesta"));
} catch (java.lang.Exception _exception) {
respuesta.value = (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("", "respuesta")), java.lang.String.class);
}
try {
error.value = (java.lang.String) _output.get(new javax.xml.namespace.QName("", "error"));
} catch (java.lang.Exception _exception) {
error.value = (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("", "error")), java.lang.String.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}
this method is included in a Java application and we don't have certification problem in it. The certificate is validated and the problem comes in the line:
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Integer(hospital), telefono, mensaje});
we have the code of the web service too, the application who contains it is right certificated too.
Anyway I was reviewing the certificates and they are not timed out.
Any idea?
Thank you.