cancel
Showing results for 
Search instead for 
Did you mean: 

EJB design for webservice

Former Member
0 Kudos

Hi,

I have to create one webservice which is for one application. This application has nine different transactions. I am developing EJB as Service Endpoint. So, Should I have one EJB which will have all those transactions or should I have one delegator EJB and the EJB implementation for each transactions? Which J2EE design pattern I should use? Can I use session facade pattern?

Please give your suggestions.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Web Service is the technology helps you expose the methods or functions of a software component as services so that a common protocol such as SOAP and common message format such as XML can be used to access the functionalities of your software component.

Having said the above FACT let me get into your CASE now.

If you have 7 or 8 transactions, each of them are being called as transaction cuz it commit a UNIT of work to fulfill a computing need. Transactions can be ATOMIC or DISTRIBUTED IN nature.

A distributed transaction is executed when two atomic or composite transaction work together to get a business work done.

If you are having 8 atomic transactions for different business needs they can be defined as 8 separate method of a stateless session bean. Each stateless session method can have a configuration parameter such as “TRANSACTION REQUIRED” = new, mean a transaction manager starts new transactions when this method got invoked.

If you do not have an intension to expose one method as an atomic transaction ( means it is always being called as part of another transaction) you can still expose it as service but provide the option Transaction support not required.

Once you have defined all methods in a stateless session bean you can create a web service for that bean so that WSDL file created will publish you all methods are separate functions (port) of your web service.

ankur_garg5
Active Contributor
0 Kudos

Hi Ritesh,

I did not really understand your problem, but nevertheless do have a look at my article:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4...

Bye

Ankur

Do reward points if it helps!!