Skip to Content
0
Former Member
Oct 23, 2009 at 10:12 AM

How to call composite application from an ejb

22 Views

Hi Guys,

I have an existing composite application exposed as a webservice. I have also created another ebj module to send out emails based on records to be retrieved via the CAF webservice.

However, how could I call the ejb from the webservice? Have tried using ejb inject as "@EJB private SPVoicesServiceBeanImpl cafservice" but Im getting a class not found exception from the log trace.

Thanks for the help

WEBSERVICE

@com.sap.caf.dt.CAFWebService(name="SPVoicesService")

@javax.jws.soap.SOAPBinding(style=javax.jws.soap.SOAPBinding.Style.RPC, use=javax.jws.soap.SOAPBinding.Use.LITERAL)

@javax.jws.WebService(serviceName="SPVoicesService", portName="SPVoicesServicePort", targetNamespace="http://www.sap.com/caf/xx.com/local.spvoicesservice/modeled", wsdlLocation="META-INF/wsdl/SPVoicesService.wsdl", name="SPVoicesService")

@javax.ejb.Remote(value={com.xx.local.spvoicesservice.modeled.appsrv.spvoicesservice.SPVoicesServiceServiceRemote.class})

@javax.ejb.Stateless(name = "com.xx.local.spvoicesservice.modeled.appsrv.spvoicesservice.SPVoicesService")

@javax.ejb.Local(value = { com.xx.local.spvoicesservice.modeled.appsrv.spvoicesservice.SPVoicesServiceServiceLocal.class })

@javax.interceptor.Interceptors(value = { com.sap.caf.rt.interceptors.LogInterceptor.class })

public class SPVoicesServiceBeanImpl

extends

com.xx.local.spvoicesservice.modeled.appsrv.spvoicesservice.SPVoicesServiceBean {

EJB Module to send out email

@MessageDriven(activationConfig={

@ActivationConfigProperty(

propertyName="messageSelector",

propertyValue="JobDefinition='SPVoicesSendReminderEmailJob'"),

@ActivationConfigProperty(

propertyName="destinationType",

propertyValue="javax.jms.Queue")})

public class SendReminderEmailJobBean extends MDBJobImplementation {

/* (non-Javadoc)

  • @see com.sap.scheduler.runtime.mdb.MDBJobImplementation#onJob(com.sap.scheduler.runtime.JobContext)

*/

@Resource(name = "mail/session") //Inject Session resource

private Session session;

@EJB private SPVoicesServiceBeanImpl cafservice;