Creating the HelloWorld EJB 
In the HelloWorldEJB project, you create a session EJB, which provides the business logic of the Web service.
In the Project Explorer, choose the HelloWorldEJB project, and then choose .
In the list of wizards, choose , and then choose Next.
In the Class Name field, enter HelloBean.
Make sure that the EJB Project field contains the HelloWorldEJB project.
In the Java Package field, enter com.sap.tutorial.helloworld.
In the Create Business Interface area, select both Remote and Local, and then choose Finish.
The system opens the created EJB session bean for editing.
Update the source code as shown in the sample below. The code shows the implementation of a Java class that returns a string: Hello, <name>.
The value of <name> is provided by user input.
Syntax
package com.sap.tutorial.helloworld;
import javax.ejb.Stateless;
@Stateless(name="HelloBean")
public class HelloBean implements HelloBeanRemote, HelloBeanLocal {
private String message = "Hello, ";
public String sayHello(String name) {
return message + name + ".";
}
}In the Project Explorer, expand the HelloWorldEJB project, and then choose .
Right-click sayHello(String), and then choose .
Save your changes.
The HelloBean.java class appears in the HelloWorldEJB project. The sayHello class is added to the local and remote Java interfaces.
Next step: Exposing the EJB as a Web Service