cancel
Showing results for 
Search instead for 
Did you mean: 

EJB model

Former Member
0 Kudos

i want to work with ejb model and webservice models.

could you help me on this .

Accepted Solutions (1)

Accepted Solutions (1)

PradeepBondla
Active Contributor
0 Kudos

Hi,

Working with EJBs...

tutorials on Adaptive Web service model

[importing web service models|http://help.sap.com/saphelp_nw04/helpdata/en/f4/abe4107f46334bb8640a090e5806fc/frameset.htm]

[steps for creating web service model|http://help.sap.com/saphelp_nw04/helpdata/en/da/2bf042493ef54499a77394ef6be096/frameset.htm]

[thread on EJB as model|;

PradeeP

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

Create your EJBs in a J2EE EJB dc. Expose the EJBs in public part as enties that can be packaged into other dcs (assembly jars)

Create web dynpro dc

Copy the java bean that access EJBs into this web dynpro dc.

Create a java bean model in Web DYnpro and consume the java beans from the same project.

Build your application over this java bean model.

You dont have to any entry in the web.xml in Web Dynpro.

See this tutorial:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e9...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20b21892-c31c-2a10-f484-fcef1eaf...

In new CE release there is EJB Model where you can consume the EJBs directly as EJB Model in Web Dynpro. Then you can create application over this EJB Model.

Steps for creation of WebServices

Go to NWDS  open perspective j2ee  select EJB Module Project create a project with name (calculator EJB)Finish

RC on ejb-jar.xml  Select new  EJB Give name to EJB Bean (First letter should be in capital letters) Select the type of bean as Stateless session bean  Give the package name to store that EJB bean nextFinish.

After that Expand ejb-jar.xml and then select the CalculateEJB  double click on Method tab  Click on business methods folder Add Create business method like a add as a method name with two parameters n1,n2

Double click on CalculateEJB RC on bean tab write required business logic in bean window as follows (based on requirement we will design business logic)

Go to project  rebuild

Till now we have created one EJB jar file then Go to FileEnterprise Application Project Create a project (CalculateEAR)

After creating a project next here we will have ear projects and then we select specific project required for our application.(here select CalculateEJB)

Here we are exposing Calculatebean as Web Service

Right click on Calculate Bean here select NewWeb Service give a name to web service and select Default configuration type as simple SOAP click on next  Select the methods which we want to expose to WebServiceNext Finish.

Created WebService and related are in ejb-jar.xml File .Expand the ejb-jar.xmlDouble click on calculate WebService

RC CalculateEJB  Build EJB Archive

RC on CalculateEAR Build Application Archive

Expand the CalculateEAR

RC on CalculateEAR.ear

Double click on calculateEAR.ear Webservice navigator tab Click on servers Expand the node select the specific WebService DC on WebService

Deploy to J2EE Engine

After that go to Web Dynpro perspective  create one WebDynpro Project Create Component CalculateComp

RC on model Select import Web Service model (last) give model name and package and select radio button as local file system or URL

Go to WSNavigatorcopy the WSDL path and paste it in model WSDL NextFinish

Afterthat same process as Adaptive RFC model

I hope it will helpful

Thanks ,

Tulasi

Former Member
0 Kudos

Hi,

Go to j2ee perspective and create EJB project in that right click on the project and create EJB, inside that write your's business methods.

After creating the project and implementing the business methods, build the EJB project, this will generate jar file.

Now you need to create Enterprise application project. Add the EJB project as module in this project. This you can do in two ways:

1. while creating Enterprise application Prject, click on next and there you can check the respective EJB project.

2. Right click the Enterprise application project, click on Add Module, there you can add the EJB project.

Now right click on the Enterprise application project, go to properties->Java Build Path->Libraries->Add Jars.

Now deploy the Enterprise application project, this will generate ear file. Deploy this ear to the server by right clicking on the ear file->Deploy to J2EE Server.

Now you can use this project into Web Dynpro or PDK by giving the references in the project. For this go to the Web Dynpro Project properties:

1. Web Dynpro References:- Sharing References. Add Enterprise application project like: sap.com/<projectName>

2. Project References:- Select the EJB and Enterprise application projects.

Hope this may help you.

Regards,

Deepak

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Below is the PDF....

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

and this is the link with some blogs on the same(EJBs in WDJava)

/docs/DOC-8061#20

Regards,

Srinivas.

Former Member
0 Kudos

Hi Jagadeesh,

Please refer to this links

link: [https://sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/600cb8d1-a8be-2910-a0b1-f13d32d42690]

Creating a Web Service from EJB

link: [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10]

Also refer this thread

Link: []

Regards,

Palani

Former Member
0 Kudos

Hi ,

check Adaptive Web Service Model documents in the below link

https://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/403e6bf5-426e-2910-b0a8-a95548724af9#...

Regards,

Sunitha Hari