* ID for the module version to obtain
* @return An {@link InputStream} with containing the obx for the module (null if error)
*/
public static InputStream getRemoteModule(ImportModule im, String moduleVersionID) {
WebServiceImplServiceLocator loc;
WebServiceImpl ws = null;
String strUrl = "";
boolean isCommercial;
try {
loc = new WebServiceImplServiceLocator();
ws = loc.getWebService();
} catch (final Exception e) {
log4j.error(e);
im.addLog("@CouldntConnectToWS@", ImportModule.MSG_ERROR);
try {
ImportModuleData.insertLog(ImportModule.pool, (im.vars == null ? "0" : im.vars.getUser()),
"", "", "", "Couldn't contact with webservice server", "E");
} catch (final ServletException ex) {
log4j.error(ex);
}
return null;
}
try {
isCommercial = ws.isCommercial(moduleVersionID);
strUrl = ws.getURLforDownload(moduleVersionID);
} catch (AxisFault e1) {
im.addLog("@" + e1.getFaultCode() + "@", ImportModule.MSG_ERROR);
return null;
} catch (RemoteException e) {
im.addLog(e.getMessage(), ImportModule.MSG_ERROR);