Red Hat
Nov 26, 2012
by Marek Goldmann

Version info

New features mentioned in this post are available in jboss-as-7.1.1-11 or newer.

Until now the webservices support was not available in the Fedora packaged JBoss AS. The main issue was the lack of CXF stack in Fedora. It took some time to make it available in an RPMified version since CXF is a pretty big project, with many submodules and a pretty nice dependency tree.

Currently in Fedora we have JBoss AS available in version 7.1.1.Final which requires CXF 2.4.6. This is a pretty old release. I decided to upgrade the CXF stack to the latest available release from the 2.6.x series. This triggered updating the jbossws-* stack to newer versions than shipped with JBoss AS 7.1.1.Final. I did some tests and it seems that the components integrate with JBoss AS seamlessly. Either case please test your application with the new stack and report any bugs.

Sample application

To ensure the webservices integration works as expected I created a small application.

      import javax.jws.WebMethod;
      import javax.jws.WebService;
      public interface Calculator {
        public float add(float a, float b);
        public float sub(float a, float b);
        public float multiply(float a, float b);
        public float divide(float a, float b);

As you can see the webservice is a very simple calculator with four basic operations. You can build the application by executing mvn package. I used the jboss-cli command to deploy the application to JBoss AS:

      [standalone@localhost:9999 /] deploy /home/goldmann/tmp/webservices.war

And here is the JBoss AS log:

      13:26:07,705 INFO  [] (MSC service thread 1-7) JBAS015876: Starting deployment of "webservices.war"
      13:26:08,749 INFO  [] (MSC service thread 1-2) JBWS024061: Adding service endpoint metadata: id=CalculatorWS
      13:26:09,597 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {}CalculatorWS from class
      13:26:11,458 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-2) Setting the server's publish address to be http://jboss-as:8080/webservices
      13:26:11,781 INFO  [] (MSC service thread 1-2) JBWS024074: WSDL published to: file:/var/lib/jboss-as/standalone/data/wsdl/webservices.war/CalculatorWS.wsdl
      13:26:11,793 INFO  [] (MSC service thread 1-4) JBAS015539: Starting service
      13:26:11,824 INFO  [] (MSC service thread 1-6) JBAS015539: Starting service"webservices.war".CalculatorWS
      13:26:11,899 INFO  [] (MSC service thread 1-6) JBWS022050: Endpoint registered:,endpoint=CalculatorWS
      13:26:12,335 INFO  [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /webservices
      13:26:12,548 INFO  [] (management-handler-thread - 1) JBAS018559: Deployed "webservices.war"

You can see the WSDL by pointing your browser to http://jboss-as:8080/webservices?wsdl.


The example applications use jboss-as as the hostname. You may want to edit the /etc/hosts file and add an entry to map this hostname to a valid IP address.

Testing the webservice

Sample calls to websevice using SoapUI

To test the service I prepared a simple standalone client. You can build it by running mvn package. To start the client just execute:

java -jar target/webservices-client-1.0.jar

and observe the output. It should be similar to what I got.

Additionally I ran some basic tests with SoapUI. I was able to create a webservice from WSDL and run some sample requests. You can see the result on the screenshot.


As you can see the webservice stack in JBoss AS in Fedora works! Of course all you saw above are basic tests. If you have something more fancy, go for it and let me know how it went.

Original Post