on 06-02-2010 9:23 AM
Hi,
I am a JEE, EJB developer who is developing a EJB module for PI.
I have implemented "Module" interface in Stateless Session Bean.
The task is to remove "LineFeed" characters from Input file and return modified file.
Here is the extract of my session bean code:-
public ModuleData process(ModuleContext moduleContext,
ModuleData inputModuleData) throws ModuleException {
Message l_msg = null;
String l_action = null;
try {
//1. Get Message Object
l_msg = (Message)inputModuleData.getPrincipalData();
//3. Reading InputStream and actionName from input moduleContext and inputModuleData
l_action = (String) moduleContext.getContextData("actionName");
category.fatalT(location, "RemoveLineFeedCharBean.process(): actionName = "+l_action);
XMLPayload xmlpayload = l_msg.getDocument();
InputStream l_inputStream = (InputStream) xmlpayload.getInputStream();
if(l_inputStream != null){
category.fatalT(location, "RemoveLineFeedCharBean.process(): InputStream isn't NULL");
//4. Calling method removeLineFeedFromFile()
byte[] l_byteContent = removeLineFeeds(l_inputStream);
//5. Set the modified content
xmlpayload.setContent(l_byteContent);
inputModuleData.setPrincipalData(l_msg);
}else{
category.fatalT(location, "RemoveLineFeedCharBean.process(): InputStream is NULL");
}
}
catch (Exception e) {
category.fatalT(location, "Exception in RemoveLineFeedCharBean.process(): "+e.toString());
}
return inputModuleData;
}
I have two questions.
1. Would I get InputStream of file at line?
XMLPayload xmlpayload = l_msg.getDocument();
InputStream l_inputStream = (InputStream) xmlpayload.getInputStream();
If not, how would i get it?
2. Where on PI 7.1 system, i could see the logs?
I mean the log statements reported by category.fatalT() method.
Thanks and regards,
Amey
have a look into that document.
Also for viewing the logs, after message processing go to the communication channel logs in the adapter for which you are developing the module.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.