Using EJB Functionality in Web Dynpro Java with the Web Service Model
Table of Contents
Overview .........................................................................................................................................................3
Scenario..........................................................................................................................................................3
Glossary..........................................................................................................................................................4
Create the Dictionary Development Component................................................................................................5
Create the database Connection Profile.........................................................................................................5
The Enterprise Java Bean 3.0 Module............................................................................................................6
Create the EJB Module DC..........................................................................................................................................7
Enable the JPA Facet in the Modify Faceted Project dialog.........................................................................................8
Configure the JPA Facet..............................................................................................................................................8
Provide a JPA Entity (detailed) ....................................................................................................................................9
Configure the Entity in the JPA Perspective...............................................................................................................10
Apply Forward Mapping .............................................................................................................................................12
The EJB Session Bean 3.0 ...........................................................................................................................13
Create the EJB Session Bean 3.0..............................................................................................................................13
Implement the business methods (detailed)...............................................................................................................13
Add the business methods to the local interface........................................................................................................15
Configure the Persistence Unit Name and the jta-data-source ..................................................................................16
The Java EE Enterprise Application Archive ................................................................................................17
Create an Enterprise Application Archive ..................................................................................................................17
Enable the SAP Data Source Aliases Provider Module .............................................................................................18
Create a Data Source Alias........................................................................................................................................18
Expose the session bean's local interface as a Web Service ....................................................................................19
Deploy the Dictionary DC..............................................................................................................................20
Deploy the Enterprise Application Archive DC .............................................................................................20
Consuming your Web Service in Web Dynpro .............................................................................................20
Create the Web Dynpro DC..........................................................................................................................21
Create the Adaptive Web Service Model ...................................................................................................................21
Create the Web Dynpro Application with default components ...................................................................................22
Apply the Service Controller Code Template .............................................................................................................23
Map the View Controller Context to the Custom Controller Context ..........................................................................24
Layout the view using templates................................................................................................................................25
Display available customer records in a Table UI element ........................................................................................25
Provide an input form to add a new customer............................................................................................................26
Add an Action Button to the input form to submit the data .........................................................................................27
Deploy new Archive and Run........................................................................................................................28
Result ............................................................................................................................................................28
Related Content ............................................................................................................................................29
Copyright...........................................................................................................................................................30
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
© 2008 SAP AG 2