We can use EJB service to receive message from locally deployed EJB applications. We can use the following steps to create a SOA application to consume message from an EJB.
- Create a SOA application
- Create an empty SOA project
- Select the SOA project created above , right click and select New option
- Select Java class and provide class name and package name and select ok
- If you get a prompt to select the folder then select project_name/src folder
- Overwrite the generated class with below sample interface code.
package svn.com.callback;
import java.util.List;
import svn.com.model.XxComStatus; // POJO class representing incoming message structure.
public interface class_name
{
public String exec(XxComStatus status);
}
import java.util.List;
import svn.com.model.XxComStatus; // POJO class representing incoming message structure.
public interface class_name
{
public String exec(XxComStatus status);
}
- Go to SOA composite add select EJB service
- Provide Service Name - ConsumeEJBMessage
- Provide a meaningful JNDI Name - ConumeCallbackMessageEJB
- Provide Java Interface Name as - svn.com.callback.class_name // Taken from above Java code.
- Open the composite SOURCE tab and add the missing values.
<service name="ConsumeEJBMessage">
<interface.java interface="svn.com.callback.class_name"/>
<binding.ejb uri="ConumeCallbackMessageEJB" ejb-version="EJB3" javaInterface="svn.com.callback.class_name"/>
</service>
- Create a BPEL process without service definition
- Now wire EJB service and BPEL. This will generate the service WSDL
- Now you can update the SOA composite as per the business requirement.
Sample Composite:
Reference : https://technology.amis.nl/it/publish-soa-composite-application-as-ejb-to-be-invoked-from-java-applications-using-ejb-binding/
No comments:
Post a Comment