I have the exact same code in my tools package
public static final void getGlobalVariable(IData pipeline) throws ServiceException {
// pipeline
IDataCursor cursor = pipeline.getCursor();
String key = IDataUtil.getString(cursor, "key");
String value = IDataUtil.getString(cursor, "defaultValue");
String ignoreError = IDataUtil.getString(cursor, "ignoreErrors");
// process
String isSecure = "false";
try {
GlobalVariablesManager manager = GlobalVariablesManager.getInstance();
GlobalVariables.GlobalVariableValue gvValue = manager.getGlobalVariableValue(key);
value = gvValue.getValue();
isSecure = "" + gvValue.isSecure();
}
catch (Exception e) {
if (value == null && (ignoreError == null || ignoreError == "false"))
throw new ServiceException(e);
}
// pipeline out
IDataUtil.put(cursor, "value", value);
IDataUtil.put(cursor, "isSecure", isSecure);
cursor.destroy();
}
and it works fine, what version of webMethods are you using ?
Also I see that you catch follows through, are you sure that the exceptions are not being triggered ?
I would put a throw new ServiceException(e) into the catch to make sure and move the .getValue() into the try clause.
regards,
John.
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods