JBoss.orgCommunity Documentation

JBoss WS User Guide

Grid Qian

Version: 1.0.1.GA

July 2008


1. JBossWS Runtime Overview
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
3. Creating a Web Service Client from a WSDL Document using JBoss WS
4. JBoss WS and development environment
4.1. JBossWS Preferences
4.2. Default Server and Runtime

JBossWS is a web service framework developed as a part of the JBoss Application Server. It implements the JAX-WS specification that defines a programming model and run-time architecture for implementing web services in Java, targeted at the Java Platform, Enterprise Edition 5 (Java EE 5).

JBossWS integrates with most current JBoss Application Server releases as well as earlier ones, that did implement the J2EE 1.4 specifications. Even though JAX-RPC, the web service specification for J2EE 1.4, is still supported JBossWS does put a clear focus on JAX-WS.

In this chapter we provide you with the necessary steps to create a Web Service using JBossWS runtime. First you need to create a Dynamic Web project:

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 link 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:


In the next chapter you will find out how to create a Web service from a Java bean.

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:

In the next chapter you will be able to create a Web Service Client from a WSDL document using JBoss WS.

To create a Web Service Client from a WSDL Document using JBoss WS you need to fulfil the following steps:

Setup JBoss WS and development environment.

Create a Dynamic Web project.

Add JBossWS Facet to Web project.

Then you can create a Web Service Client from a WSDL document:

After the Web Service Client has been created, the following may occur depending on the options you selected:

JBoss WS use a Java class to test Web Service. A client sample class will be generated, you may run this client as a java application to call a web service.

In this chapter you will learn how to change JBossWS preferences and how to set default server and runtime.