Using Axis Web Services with JBoss: Migration to modern JAX-WS with WildFly 41
TL;DR: SOAP Modernization Guide
Apache Axis 1.x is obsolete and insecure. This guide outlines how to migrate your legacy SOAP applications to Jakarta EE 11 and WildFly 41.0.1.Final using the reference Apache CXF (JBossWS-CXF) stack. We cover the transition from javax.* to jakarta.* namespaces, robust timeout controls, secure HTTPS setups, and cloud deployment parameters. Legacy Axis configuration for JBoss 5 is preserved at the bottom for reference.
Apache Axis is a legacy implementation of the SOAP (Simple Object Access Protocol). This project has been decommissioned in favor of Apache CXF, therefore it is highly recommended that you migrate your Axis Web services to Apache CXF.
If you need to run modern SOAP services in WildFly 41.0.1.Final, you will target Jakarta XML Web Services 4.0 (part of Jakarta EE 11), implemented under the hood by JBossWS-CXF. If you still have extremely old legacy deployments containing embedded Axis libraries, you must prevent WildFly from attempting to process them using its modern subsystem. Exclude the webservices subsystem in your jboss-deployment-structure.xml as follows:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="webservices"/>
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
However, running obsolete libraries on modern JVMs (Java 17/21+) is highly discouraged due to bytecode incompatibilities and massive security vulnerabilities. Below, we explain how to transition to the modern SOAP stack.
SOAP vs. REST in Enterprise Architectures
While REST has become the default choice for public-facing web APIs due to its simplicity and lightweight JSON payloads, SOAP remains highly relevant in enterprise integrations. Key reasons to use SOAP include:
- Strict Service Contracts: WSDL (Web Services Description Language) guarantees strong typing and a formal interface agreement between clients and servers.
- WS-Security (WS-M): Offers message-level security, XML encryption, and digital signatures.
- Stateful Transactions: Standards like WS-ReliableMessaging and WS-Coordination are crucial for complex financial or transactional orchestrations.
Modern JAX-WS Web Services on WildFly 41
To write a modern SOAP Web Service compliant with Jakarta EE 11, use the jakarta.jws.* and jakarta.xml.ws.* packages. Here is the modern equivalent of the original HelloWorld service:
package com.mastertheboss.jaxws;
import jakarta.jws.WebMethod;
import jakarta.jws.WebService;
import jakarta.jws.WebParam;
@WebService(targetNamespace = "http://mastertheboss.com/jaxws")
public class HelloWorld {
@WebMethod
public String hello(@WebParam(name = "message") String message) {
return "Invoked with " + message;
}
}
Maven Configuration (pom.xml)
For Jakarta EE 11 development, declare the provided API dependencies in your Maven project. The WildFly runtime provides the implementation classes at deploy time:
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-web-api</artifactId>
<version>11.0.0-M1</version>
<scope>provided</scope>
</dependency>
</dependencies>
Securing the SOAP Endpoint
Never recommend or deploy Basic Authentication over plain HTTP. In production environments, rely on HTTPS/TLS to encrypt transmission payloads. On WildFly 41, you should secure the endpoint in standalone.xml (or via JBoss CLI) to accept requests only on secure ports.
To configure message-level security (e.g., WS-Security with X.509 tokens), add Apache CXF interceptors or specify a security policy within the WSDL contract.
Timeouts, Debugging, and Performance Configuration
Configuring timeouts properly prevents network hangs and thread starvation in high-throughput environments.
Client-Side Timeouts
In Jakarta XML Web Services, timeouts can be set using standard properties on the BindingProvider:
import jakarta.xml.ws.BindingProvider;
import jakarta.xml.ws.Service;
import java.net.URL;
import javax.xml.namespace.QName;
// Instantiate the service client
URL wsdlURL = new URL("https://localhost:8443/your-context/HelloWorld?wsdl");
QName qname = new QName("http://mastertheboss.com/jaxws", "HelloWorldService");
Service service = Service.create(wsdlURL, qname);
HelloWorld port = service.getPort(HelloWorld.class);
// Configure connection and read timeouts
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put("jakarta.xml.ws.client.connectionTimeout", 5000); // 5 seconds
bp.getRequestContext().put("jakarta.xml.ws.client.receiveTimeout", 15000); // 15 seconds
Handlers vs. Interceptors
It is important to understand the division of labor in the Apache CXF / WildFly stack:
- JAX-WS Handlers: Standard, portable SOAP handlers (implementing
jakarta.xml.ws.handler.Handler). Use these if your application needs to run unmodified on other application servers (e.g., WebSphere or WebLogic). - Apache CXF Interceptors: Proprietary, performance-optimized, phase-based interceptors. They are superior for accessing raw XML streams, managing custom security parameters, and executing low-level payload parsing.
Cloud, Reverse Proxy, and Kubernetes Deployment
When deploying WildFly 41 inside Kubernetes/OpenShift or behind a reverse proxy (such as Nginx or Apache HTTPD), the generated WSDL address must reflect the public-facing hostname instead of the internal container IP.
Configure WildFly's webservices subsystem using the JBoss CLI to dynamically or statically rewrite the WSDL SOAP address host:
/subsystem=webservices:write-attribute(name=wsdl-host, value=jbossws.undefined)
/subsystem=webservices:write-attribute(name=wsdl-secure-port, value=443)
/subsystem=webservices:write-attribute(name=wsdl-uri-scheme, value=https)
Setting wsdl-host to jbossws.undefined forces WildFly to construct the host part of the WSDL endpoint address from the incoming HTTP request header (Host header).
Testing SOAP Web Services
Do not rely on old Eclipse plugins. Instead, test your deployments using SoapUI, modern IDE plugins, or standard command-line tools like curl. Below is a raw POST query example to test the endpoint:
curl -X POST -H "Content-Type: text/xml; charset=utf-8" \
-d '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jax="http://mastertheboss.com/jaxws">
<soapenv:Header/>
<soapenv:Body>
<jax:hello>
<message>World</message>
</jax:hello>
</soapenv:Body>
</soapenv:Envelope>' \
https://localhost:8443/your-context/HelloWorld
Legacy Archive: Using Apache Axis with JBoss 5
Warning: The content below is preserved for historical purposes and applies strictly to old, non-supported configurations on JBoss 5. For any modern production workloads, use JAX-WS and Apache CXF shown above.
Still not ready for JBoss WS? If you don’t have a JDK 1.5 compliant environment then consider using Axis as your Web Service Engine. It’s robust, stable and easy to setup.
Axis is essentially a SOAP engine, that is a framework for constructing SOAP processors such as clients, servers, gateways, etc. The first thing to do is installing Axis engine on JBoss.
Installing Axis on JBoss
At first download Axis from the Apache project: http://ws.apache.org/axis/java/index.html
Explode the zip folder. Now you need to deploy the Axis engine to JBoss Web Engine (Tomcat).
Here’s how to do it: rename the folder axis under AXIS_HOME/webapps to axis.war and copy the folder under “deploy” of your JBoss
Publishing Web Services with Axis
Let’s say we have a simple class like the following:
package test;
public class HelloWorld {
public String hello(String message) {
return "Invoked with " + message;
}
}
How do we go about making this class available via SOAP? There are a couple of answers to that question, but we’ll start with an easy solution.
At first compile the class:
javac -d . HelloWorld.java
Now copy the class under WEB-INF/classes of your axis.war
Ok, now the last step is registering your Web Service so that Axis is aware of it. A Web Service can be registered with a Deployment Descriptor (WSDD) file. A deployment descriptor contains a bunch of things you want to “deploy” into Axis – i.e. make available to the Axis engine.
Here’s a simple wsdd file for our WebService:
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="HelloWorld" provider="java:RPC">
<parameter name="className" value="test.HelloWorld"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>
Pretty simple, really – the outermost element tells the engine that this is a WSDD deployment, and defines the “java” namespace. Then the service element actually defines the service for us. A service is a targeted chain which means it may have any of: a request flow, a provider, and a response flow.
In this case, our provider is “java:RPC”, which is built into Axis, and indicates a Java RPC service. We need to tell the RPCProvider that it should instantiate and call the correct class (e.g. test.HelloWorld), and another to tell the engine that any public method on that class may be called via SOAP (that’s what the “*” means)
Now save your wsdd file as deploy.wsdd and run the AdminClient which is an Utility to deploy the WebService:
java -classpath %AXIS_HOME%/lib/axis.jar;%AXIS_HOME%/lib/commons-discovery-0.2.jar;%AXIS_HOME%/lib/commons-logging-1.0.4.jar;%AXIS_HOME%/lib/saaj.jar;%AXIS_HOME%/lib/jaxrpc.jar org.apache.axis.client.AdminClient deploy.wsdd
If everything was Ok now you should see the WebService deployed on Axis: check the “List” option from the URL http://localhost:8080/axis/
The client
Let’s take a look at an example Web Service client that will call the hello method of the HelloWorld Web Service:
package test;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import java.net.URL;
public class Client {
public static void main (String args[]) {
try {
String url;
url="http://localhost:8080/axis/services/HelloWorld";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new URL(url));
call.setOperationName(new QName("HelloWorld", "hello"));
Object[] params = new Object[1];
params[0] = "Hello Message";
Object result = call.invoke(params);
System.out.println("result is " + result);
}
catch(Exception e) {
e.printStackTrace();
}
}
}
In order to invoke our Web Service we use the Service and Call objects. These are the standard JAX-RPC objects that are used to store metadata about the service to invoke. With this we set up our endpoint URL – this is the destination for our SOAP message.
call.setTargetEndpointAddress(new URL(url));
With this we define the operation (method) name of the Web Service.
call.setOperationName(new QName("HelloWorld", "hello"));
Then we actually invoke the desired service, passing in an array of parameters – in this case just one String.
Object result = call.invoke(params);
Obtaining WSDL for deployed services
When you make a service available using Axis, there is typically a unique URL associated with that service. For our service it’s http://localhost:8080/axis/services/HelloWorld?wsdl
When you point your browser to that location, Axis will automatically generate a service description for the deployed service, and return it as XML in your browser:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
targetNamespace="http://localhost:8080/axis/services/HelloWorld"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/services/HelloWorld"
xmlns:intf="http://localhost:8080/axis/services/HelloWorld"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="helloRequest">
<wsdl:part name="in0" type="xsd:string" />
</wsdl:message>
<wsdl:message name="helloResponse">
<wsdl:part name="helloReturn" type="xsd:string" />
</wsdl:message>
<wsdl:portType name="HelloWorld">
<wsdl:operation name="hello" parameterOrder="in0">
<wsdl:input message="impl:helloRequest" name="helloRequest" />
<wsdl:output message="impl:helloResponse"
name="helloResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldSoapBinding" type="impl:HelloWorld">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="hello">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="helloRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://test" use="encoded" />
</wsdl:input>
<wsdl:output name="helloResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8080/axis/services/HelloWorld"
use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldService">
<wsdl:port binding="impl:HelloWorldSoapBinding"
name="HelloWorld">
<wsdlsoap:address
location="http://localhost:8080/axis/services/HelloWorld" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Generating Java Classes from WSDL
Another approach is to generate Java Classes starting from WSDL contract. You can use the AdminClient to follow this approach:
java -classpath %AXIS_HOME%/lib/wsdl4j-1.5.1.jar;%AXIS_HOME%/lib/axis.jar;%AXIS_HOME%/lib/commons-discovery-0.2.jar;%AXIS_HOME%/lib/commons-logging-1.0.4.jar;%AXIS_HOME%/lib/saaj.jar;%AXIS_HOME%/lib/jaxrpc.jar org.apache.axis.wsdl.WSDL2Java http://localhost:8080/axis/services/HelloWorld?wsdl
This will generate the following classes under the service namespace which is localhost\axis\services\HelloWorld:
HelloWorld.java
HelloWorldService.java
HelloWorldServiceLocator.java
HelloWorldSoapBindingStub.java
Generating Java Classes from the WSDL is defined as “top-down” approach, while generating WSDL from Java classes is called “bottom-up” style.
Although bottom-up Web service development may be faster and easier, especially if you are new to Web services, the top-down approach is the recommended way of creating a Web service. By creating the WSDL file first you will ultimately have more control over the Web service, and can eliminate interoperability issues that may arise when creating a Web service using the bottom-up method.
Frequently Asked Questions (FAQs)
1. Why can't I run Apache Axis on modern WildFly 41?
Apache Axis 1.x depends on old JAX-RPC standards that were fully removed from modern Java platforms and WildFly runtimes. Attempting to deploy old Axis application modules directly will result in massive security violations, classpath conflicts, and runtime execution errors.
2. How does WildFly 41 support modern Jakarta SOAP services?
WildFly 41 natively implements the Jakarta XML Web Services 4.0 standard (part of Jakarta EE 11) through the integrated JBossWS-CXF module, which leverages Apache CXF under the hood. No manual library deployment is required.
3. What's the difference between JAX-WS Handlers and CXF Interceptors?
JAX-WS Handlers are standard Java components portable across JEE application servers. Apache CXF Interceptors are highly specialized, high-performance, phase-based pipeline objects native to Apache CXF. We recommend using CXF Interceptors for WildFly-specific performance enhancements.
Recommended Articles
Developing SOAP Web Services on WildFly 41 (Jakarta EE 11) with Apache CXF
Learn how to develop, deploy, and secure Jakarta XML Web Services (SOAP) on WildFly 41.0.1.Final and Jakarta EE 11 using Apache CXF, WS-Security, and modern testing tools.
How to develop CXF Web services with JBoss / WildFly
Learn how to develop, deploy, and secure SOAP Web Services on WildFly 41.0.1.Final using Jakarta EE 11 and Apache CXF. Master JAX-WS handlers, CXF interceptors, and robust cloud configurations.
Apache CXF Interceptors on WildFly 41 and Jakarta EE 11
Learn how to write, configure, and customize Apache CXF Interceptors on WildFly 41.0.1.Final and Jakarta EE 11. Upgrade from legacy configuration to modern Jakarta XML Web Services.
Disable JAX-WS SOAP Web Services on WildFly Application Server - Comprehensive Guide
Learn how to disable JAX-WS SOAP Web Services at both application and subsystem levels in WildFly. #WildFly #Java #Middleware
