JBoss.orgCommunity Documentation

Chapter 2. Creating a Web Service using JBossWS runtime

2.1. Creating a Dynamic Web project
2.2. Configure JBoss Web Service facet settings
2.3. Creating a Web Service from a WSDL document using JBossWS runtime
2.4. Creating a Web service from a Java bean using JBossWS runtime

In this chapter we provide you with the necessary steps to create a Web Service using JBossWS runtime.

Before creating a web service, you should have a Dynamic Web Project created:


Create a Web project by selecting New > Project... > Dynamic Web project. Enter the following information:

Click on the Finish button.

If you have already created a new Dynamic Web project, the next step is to add JBoss Web Service facet to the project:


Server Supplied JBossWS Runtime: If you have already set a JBoss runtime to the project's target runtime, you may choose Server Supplied JBossWS Runtime and then click Ok to finish the configuration of JBoss Web Service facet.

If the project has no Target Runtime settings, you should check the second radio button and specify a JBossWS runtime from the list. You also can create a new JBossWS runtime, click on the New... button will bring you to another dialog to configure new JBossWS runtime.


See how to configure a new JBossWS runtime here:

In this chapter we provide you with the necessary steps to create a Web Service from a WSDL document using JBossWS runtime.

At first, please make sure that you have already created a dynamic Web project with JBoss Web Service facet installed.

See how to make it here> and here.

To create a Web Service using JBossWS runtime select File > New > Other > Web Services > Web Service to run Web Service creation wizard.

Let's get through the wizard step-by-step:


First, please select Top down Java bean Web Service from the Web Service type list, and select a WSDL document from workspace, click on the Server name lilnk on the page will bring you to another dialog. Here you can specify the server to a JBoss Server and Web Service runtime to JBossWS runtime:


Click on the Finish button to see the next wizard view opened:


Click on the Next button to proceed:


On this page, the default package name comes from the namespace of the WSDL document, you also can change it to any valid package name you want. JAX-WS specification should be set to 2.0 if your JBossWS runtime in JBoss Server is JBossWS native runtime. You can specify a catalog file and binding files if you have them. If you want the wizard to generate empty implementation classes for the Web Service, check the Generate default Web Service implementation classes check box. If you want to update the default Web.xml file with the Web Service servlets configured, check the Update the default Web.xml check box. Click on the Next or on the Finish button to generate code.

Once the Web Service code is generated, you can view the implementation class and add business logic to each method.


View the Web.xml file:


The Web Service wizard assists you in creating a new Web service, configuring it for deployment, and then deploying it to the server.

To create a Web service from a bean using JBoss WS:

Setup JBoss WS and development environment.

Create a Dynamic Web project.

Add JBossWS Facet to Web project.

Create a Web Service from a java bean:

After the Web Service has been created, the following options may become available depending on the options selected: