Java service -
i/p pipeline - package (string)
o/p pipeline - services (string list)
IDataCursor idatacursor = pipeline.getCursor();
String s = IDataUtil.getString(idatacursor, "package");
int i = s.lastIndexOf(File.separator) + 1;
String s1 = s.substring(i);
IData idata1 = IDataFactory.create();
IDataCursor idatacursor1 = idata1.getCursor();
IDataUtil.put(idatacursor1, "showServices", "true");
IDataUtil.put(idatacursor1, "package", s1);
IData idata2 = IDataFactory.create();
String as[] = null;
try
{
IData idata3 = Service.doInvoke("wm.server.packages.adminui", "packageInfo", idata1);
IDataCursor idatacursor2 = idata3.getCursor();
as = IDataUtil.getStringArray(idatacursor2, "services");
idatacursor2.destroy();
}
catch(Exception exception) { }
IDataUtil.put(idatacursor, "services", as);
IDataUtil.put(idatacursor, "index", (new StringBuilder()).append("").append(s1).toString());
idatacursor.destroy();
Runtime - Give the package name as the input. Output will be list of all services in that package.
hmmm... may be I can enhance above code, to use characters(%,*,?) in the package name? Yes, it will be handy.
cheers!
no need for Java service.
ReplyDeleteThe inbuilt service can be directly used.
What is the inbuilt service name? can you please tell
ReplyDeleteHi naidu , I am getting error for this line:-
ReplyDeleteint i = s.lastIndexOf(File.separator) + 1; as File cannot be resolved as a variable
I need one clarification.I am getting flat file schemas also as part of the services in the output
ReplyDelete