<!--
  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title/>
    </head>
    <body>
        <p>[
            <a
                    href="http://dist.wso2.org/products/wsas/java/@wso2wsas_version@">Download</a>
            ]
            | [
            <a href="index_docs.html">Documentation Home</a>
            ] | [
            <a
                    href="release_notes.html">Release Note</a>
            ]
        </p>

        <h1>EJB Service Guide</h1>

        <p>This document provides instructions exposing EJBs as Web services using
            WSO2 WSAS.</p>

        <p>Your feedback on WSO2 WSAS is most appreciated. Please send them to our
            <a
                    href="mail-lists.html">mailing lists</a>
            .
        </p>

        <h3>EJB Service Provider</h3>

        <p></p>
        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.

        <p>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.</p>

        <p></p>

        <p>
            <strong>Contents</strong>
        </p>

        <div class="toc">
            <ul>
                <li>
                    <a href="#Step1">Step 1 - EJB Provider Configuration</a>
                </li>
                <li>
                    <a href="#Step2">Step 2 - Upload Interface</a>
                </li>
                <li>
                    <a href="#Step3">Step 3 - Select Classes</a>
                </li>
                <li>
                    <a href="#Step4">Step 4 - Deploy Service</a>
                </li>
            </ul>
        </div>

        <p></p>

        <h4>Instructions</h4>

        <p>
            <strong>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.</strong>
        </p>
        <br/>

        <p>After you have logged in to WSAS, click
            <strong>Services</strong>
            .
        </p>

        <p>Then click
            <strong>Define EJB Service</strong>
            to configure an EJB to be
            exposed as a Web service.
        </p>
        <br/>
        <br/>
        <img alt="" src="images/available_services-new.jpg"/>
        <br/>

        <a name="Step1"></a>
        <h4>Step 1 - EJB Provider Configuration</h4>

        <p>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.</p>
        <br/>
        <p>
            <img alt="" src="images/ejb_guide/screen2.jpg"/>
            <br/>
        </p>
        <br/>
        <br/>
        <p>Also, there are no servers configured yet. So, click
            <strong>Add
                New</strong>
            .
        </p>
        <br/>
        <p>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 '
            <strong>Generic</strong>
            '. Refer to your
            application server documentation/configuration for the values and the field
            descriptions.
        </p>
        <br/>
        <p>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
            <strong>Add Application Server</strong>
            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
            <strong>Next</strong>
            .
        </p>
        <br/>
        <a name="Step2"></a>
        <h4>Step 2 - Upload Interface</h4>

        <p>On the next page, provide the path to the .jar or .zip file containing the
            home and remote interfaces for your EJB.</p>
        <br/>
        <br/>
        <img alt="" src="images/ejb_guide/screen3.jpg"/>
        <br/>
        <br/>
        Click
        <strong>Next</strong>
        .
        <br/>
        <a name="Step3"></a>
        <h4>Step 3 - Select Classes</h4>
        <br/>
        <p>On the next page, you will see a list of the remote/home interfaces
            available in the archive, you selected on the previous page.</p>
        <br/>
        <img alt="" src="images/ejb_guide/screen4.jpg"/>
        <br/>
        <br/>


        <p>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
            <strong>Next</strong>.
        </p>
        <br/>

        <a name="Step4"></a>
        <h4>Step 4 - Deploy Service</h4>
        <br/>
        <p>Choose an existing Service Group to deploy the EJB service into, or create
            a new one. Click
            <strong>Deploy Service</strong>.
        </p>
        <br/>
        <br/>

        <p>If the service deployment was successful, a message will appear informing
            you so.</p>
        <br/>
        <br/>
        <img alt="" src="images/ejb_guide/screen5.jpg"/>
        <br/>
        <br/>


        <p>Once the WSAS Services page has been refreshed, you should be able to see the new
            services you
            just exposed. Congratulations!</p>
        <br/>
        <a name="ejb_param_edit"></a>

        <p>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.</p>
        <br/>
        <img alt="" src="images/ejb_guide/param_edit.jpg"/>
        <br/>
        <br/>

        <br/>
        <h3></h3>
    </body>
</html>
