Hi All
I have a scenario where I am picking up a set of files using the File Adapter Sender. The polling is set to 60 seconds and the processing paramerter are EOIO. I have a bean in place to convert the file so picked up into Base64.
What I see happen is that the Bean is returning the same converted string for more then a couple of messages ie.
File1 -> Bean Conversion -> File1 Converted Message
File2 -> Bean Conversion -> File1 Converted Message
File3 -> Bean Conversion -> File1 Converted Message
In the later two cases it should have returned
File2 Converted Message
File3 Converted Message
Why is this happening ? How can I trace this to see what is wrong. Isnt the Module context and Module Data supposed to change with each case.
Here is the code in my Bean
package mckpedBase64;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.CreateException;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
import com.sap.aii.utilxi.base64.api.Base64;
/**
@ejbHome <{mckpedBase64.ConvertoBase64Home}>
@ejbLocal <{mckpedBase64.ConvertoBase64Local}>
@ejbLocalHome <{mckpedBase64.ConvertoBase64LocalHome}>
@ejbRemote <{mckpedBase64.ConvertoBase64}>
@stateless
@transactionType Container
*/
public class ConvertoBase64Bean implements SessionBean, Module {
public void ejbRemove() {
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void setSessionContext(SessionContext context) {
myContext = context;
}
private SessionContext myContext;
/**
Business Method.
*/
public ModuleData process(
ModuleContext modulecontext,
ModuleData inputModuleData) {
try{
Object obj = null;
Message msg = null;
XMLPayload xmlpayload = null;
String str_b64 = " ";
String xmldata = " ";
obj = inputModuleData.getPrincipalData();
msg = (Message) obj;
//Payload payload = msg.getDocument();
xmlpayload = msg.getDocument();
str_b64 = com.sap.aii.utilxi.base64.api.Base64.encode(xmlpayload.getContent());
xmldata =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"
+ "<ns:"
+ "MC_SOAPFile_mt"
+ " xmlns:ns=\""
+ "http:/MCK_FILERFCSOAPRFC.COM"
+ "\">\n"
+ "<MCREQ>"
+ str_b64
+ "</MCREQ>\n"
+ "</ns:"
+ "MC_SOAPFile_mt"
+ ">";
xmlpayload.setContent(xmldata.getBytes());
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {}
//System.out.print(e.getMessage());}
return inputModuleData;
}
/**
Create Method.
*/
public void ejbCreate() throws CreateException {
}
}
Regards
Aju Paul