background image

Deploying the helloservice Example

<< Web Service Endpoint Implementation Class | Testing the Service without a Client >>
<< Web Service Endpoint Implementation Class | Testing the Service without a Client >>

Deploying the helloservice Example

@WebService
public class HelloServiceBean {
private String message =
"Hello, ";
public void HelloServiceBean() {}
@WebMethod
public String sayHello(String name) {
return message + name +
".";
}
}
Building, Packaging, Deploying, and Testing the
helloservice
Example
You can build, package, and deploy the helloservice example using either NetBeans IDE or
Ant. You can then use the Admin Console to test the web service endpoint methods.
Building, Packaging, and Deploying the helloservice Example Using
NetBeans IDE
Follow these instructions to build, package, and deploy the helloservice example to your
Application Server instance using the NetBeans IDE IDE.
1. In NetBeans IDE, select File
Open Project.
2. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/ejb/.
3. Select the helloservice folder.
4. Select the Open as Main Project and Open Required Projects check boxes.
5. Click Open Project Folder.
6. In the Projects tab, right-click the helloservice project and select Deploy Project.
This builds and packages to application into helloservice.ear, located in
tut-install/javaeetutorial5/examples/ejb/helloservice/dist, and deploys this ear file to
your Application Server instance.
A Web Service Example: helloservice
Chapter 22 · Session Bean Examples
667