cancel
Showing results for 
Search instead for 
Did you mean: 

How to call XIMailAdapterBean from my 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 (3)

Answers (3)

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_member185881
Active Participant
0 Kudos

Hi Sumant

You can call XIMailAdapterBean through your communication channel.

under module tab -->

make an entry of XIMailAdapterBean above the sapcallAdapter -->

sapcallAdapter kaey is 0 there -->

your XIMailAdapterBean key will be 1.

if not clear you can ask again.

Regards

Dheeraj Kumar

Former Member
Former Member
0 Kudos

Any help on this?