String errMsg = "Error saving message to file [" + saveToFilename + "]: " + e.toString();
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
} else if (UtilValidate.isNotEmpty(sendToUrl)) {
HttpClient http = new HttpClient(sendToUrl);
// test parameters
http.setHostVerificationLevel(SSLUtil.HOSTCERT_NO_CHECK);
http.setAllowUntrusted(true);
http.setDebug(true);
// needed XML post parameters
if (UtilValidate.isNotEmpty(certAlias)) {
http.setClientCertificateAlias(certAlias);
}
if (UtilValidate.isNotEmpty(basicAuthUsername)) {
http.setBasicAuthInfo(basicAuthUsername, basicAuthPassword);
}
http.setContentType("text/xml");
http.setKeepAlive(true);
try {
http.post(outText);
} catch (Exception e) {
String errMsg = "Error posting message to server with URL [" + sendToUrl + "]: " + e.toString();
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}