cancel
Showing results for 
Search instead for 
Did you mean: 

How to call XIMailAdapterBean from my SAP PI module processor?

Former Member
0 Kudos

Hi Experts,

I want to call XIMailAdapterBean from my module processor. How do we do that?

I am creating following entry in the ejb-jar.xml


                                           <ejb-local-ref>
				<ejb-ref-name>XIMailAdapterBean</ejb-ref-name>
				<ejb-ref-type>Session</ejb-ref-type>
				<local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
				<local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
				<ejb-link>sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean</ejb-link>
		</ejb-local-ref>

and using the following code


Context initCtx = new InitialContext();
Object result = initCtx.lookup("java:comp/env/XIMailAdapterBean");
					
ModuleHome moduleHome = (ModuleHome) PortableRemoteObject.narrow(result, com.sap.aii.adapter.mail.app.XIMailAdapterBean.class);
inputModuleData = moduleHome.create().process(moduleContext, inputModuleData);

Is this the right way to do it?

Regards,

SK

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Solution:

ejb-jar.xml

<ejb-local-ref>

<ejb-ref-name>XIMailAdapterBean</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>

<local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>

<ejb-link>XIMailAdapterBean</ejb-link>

</ejb-local-ref>

Code:

Context initCtx = new InitialContext();

Object result = initCtx.lookup("java:comp/env/XIMailAdapterBean");

ModuleLocalHome moduleLocalHome = (ModuleLocalHome) result ;

inputModuleData = moduleLocalHome.create().process(moduleContext, inputModuleData);

Former Member
0 Kudos

Any response?