tell me more icon Creating an EJB Web Service

In JDeveloper's IDE, you can quickly create a session bean and create business methods declaratively. To begin creating a session bean, you will open the Create Session Bean wizard. To open the wizard, in the Application Navigator, right click a project and choose New . In the New Gallery, expand Business Tier and select EJB in the Categories tree and select Session Bean from the Items list, and click OK.

New Gallery, EJB, Session Bean

In the example, you will create a stateless session bean that is hosted in an EJB container.

EJB Name and Options

In the source editor, you will add a business method to the session bean. The method calculates the cost of freight based on a destination and the quantity ordered after subtracting a discount based on the customer code.

Source editor,

Then you will create a web service to expose the method in the session bean as an operation in the service. To begin creating a web service, you will right-click the session bean in the Application Navigator, and choose Cr eate Web Service from the context menu to launch the Create Java Web Service wizard.

Create Web Service context menu option

In the wizard, you will accept the default web service name and port name, then select SOAP 1.2 binding and the Document/Wrapped SOAP message format.

Create Java Web Service wizard, Message Format

You will test the web service in the HTTP Analyzer before you create the web service data control.

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,