Documentation

##### WSO2 WSAS 2.1-RC6

- Contents
- Home

##### Downloads

- Releases

##### Documentation

- User Guide
- FAQs
- Installation Guide
- Source
- Running Behind a Proxy
- Data Services Guide
- EJB Guide
- Clustering Guide
- XKMS Guide
- Changing Keys

##### Samples

- Chad
- Commodity Quote
- Data Services
- Flickr
- Javascript
- STS
- Trader
- Tiny URL

##### API Documentation

- Java Docs

##### Tools

- Code Generation
- Change Password
- Eclipse IDE Integration
- TCP Monitor
- WSDL2Code
- WSDL View
- Try It
- AAR Validation
- MAR Validation

##### Resources

- News

##### Get Involved

- Mailing Lists
- Release Process
- Integration

##### Project Information

- Project Team
- Issue Tracking
- License

[Download] | [Documentation Home] | [Release Note]

# EJB Service Guide

This document provides instructions exposing EJBs as Web services using WSO2 WSAS .

Your feedback on WSO2 WSAS is most appreciated. Please send them to our mailing lists.

### EJB Service Provider

WSAS makes it possible for you to expose an EJB deployed in you application server (JBoss, Apache Geronimo, BEA WebLogic or other) as a Web service.

Once you have the EJB deployed in your application server, all you need to do is show WSAS the location of the archive containing the remote/home interfaces, enter the details for the interface, JNDI bean names etc, and WSAS will take care of exposing the EJB as a Web service. WSAS will communicate with the EJB using JNDI, which the WS client just sees as yet another Web service.

Table of Contents

#### Instructions

Before you start WSAS, make sure you've started the J2EE Application Server where your EJB is deployed, and copy the client .jars of your J2EE Application Server to either WSO2WSAS_HOME/lib folder or onto the classpath. After you have logged in to WSAS, click Services. Then click Define EJB Service to configure an EJB to be exposed as a Web service.

#### Step 1 - EJB Provider Configuration

On the next screen, enter the details of the application server on which you have your EJBs deployed. If this is the first time you're attempting to do this, under Existing configurations, "No existing EJB Configurations" will be displayed.

Also, there are no servers configured yet. So, click Add New.

Select your application server from the list. WSAS comes pre-configured with some of the settings for the following application servers: JBoss, Apache Geronimo, and BEA WebLogic. If you use an application server other than one of these, please select 'Generic'. Refer to your application server documentation/configuration for the values and the field descriptions.

If your application server requires a username and password for logging in, please enter them on this page. Once you have entered the details, click Add Application Server to add the server to the configuration. If the configuration details were entered correctly, now you should see the server you configured in the Use Existing list. You can enter other application server configurations if you need to. Otherwise, click Next.

#### Step 2 - Upload Interface

On the next page, provide the path to the .jar or .zip file containing the home and remote interfaces for your EJB.

Click Next.

#### Step 3 - Select Classes

On the next page, you will see a list of the remote/home interfaces available in the archive, you selected on the previous page.

Here you can select the interfaces that will be used as the remote and home interfaces. Accordingly, the two fields (Home Interface and Remote Interface) in the EJB details table will be populated automatically. You will have to fill in the JNDI Bean Name for your EJB manually. Click Next.

#### Step 4 - Deploy Service

Choose an existing Service Group to deploy the EJB service into, or create a new one. Click Deploy Service.

If the service deployment was successful, a message will appear informing you so.

Once WSAS has refreshed, you should be able to see the new services you just exposed. Congratulations!

If you select the EJB service from the main Services page and click on 'Edit EJB Service' option, you'll be taken to a page with the service parameters for the EJB service. Be careful when you edit any of the parameters here, as an erroneous edit may result in your EJB service becoming faulty.

###