How to disable SOAP Web Services in WildFly

This is a short tutorial to discuss how to disable JAX-WS Web services (SOAP Web Services) from WildFly application server. We will show how to do it at application level or at subsystem level.

Disabling JAX-WS at Server Level

If you don’t use any JAX-WS feature in all your applications then you can just disable it at server level. In order to do that, we will remove the webservices subsystem and its extension.

Connect to the CLI and execute the following command:

/subsystem=webservices:remove
{
    "outcome" => "success",
    "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"
    }
}

Then, remove the extension:

/extension=org.jboss.as.webservices:remove
{
    "outcome" => "success",
    "response-headers" => {"process-state" => "reload-required"}
}

You need to restart the server for changes to take effect.

Disabling JAX-WS at deployment level

In order to disable SOAP Web Services for a specific deployment you can use the jboss-deployment-structure.xml file in your application:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
  <deployment>
     <exclude-subsystems>
        <subsystem name="webservices"/>
    </exclude-subsystems>
  </deployment>
</jboss-deployment-structure>

Finally, if your Web application belongs to an EAR archive, then you need to use the sub-deployment element in your configuration to reference it. For example:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
  ...
  <sub-deployment name="myapp.war">
     <exclude-subsystems>
        <subsystem name="webservices"/>
    </exclude-subsystems>
    <dependencies>
       ...
    </dependencies>
  </sub-deployment>
</jboss-deployment-structure>

To learn more about this deployment unit check this article: Examples of jboss-deployment-structure.xml

Found the article helpful? if so please follow us on Socials