How to change the default Web Service deployment Port ?

SOAP Web services running on WildFly or JBoss EAP 7 can customize the deployment port of the Web service by setting the wsdl-port or wsdl-secure-port of the webservices subsystem.

Let’s see an example:

/subsystem=webservices:write-attribute(name=wsdl-port,value=8090)

On the other hand, if you want to modify the WSDL Secure Port, you can use the following CLI Command:

/subsystem=webservices:write-attribute(name=wsdl-secure-port,value=8453)

Now deploy a sample Web service and check the Web Service WSDL URL:

/deployment=jaxws-pojo-service.war/subsystem=webservices/endpoint=jaxws-pojo-endpoint%3Aorg.jboss.quickstarts.ws.jaxws.samples.jsr181pojo.JSEBean:read-resource(include-runtime=true)
{
    "outcome" => "success",
    "result" => {
        "average-processing-time" => 0L,
        "class" => "org.jboss.quickstarts.ws.jaxws.samples.jsr181pojo.JSEBean",
        "context" => "jaxws-pojo-endpoint",
        "fault-count" => 0L,
        "max-processing-time" => 0L,
        "min-processing-time" => 0L,
        "name" => "org.jboss.quickstarts.ws.jaxws.samples.jsr181pojo.JSEBean",
        "request-count" => 0L,
        "response-count" => 0L,
        "total-processing-time" => 0L,
        "type" => "JAXWS_JSE",
        "wsdl-url" => "http://localhost:8090/jaxws-pojo-endpoint/JSEBean?wsdl"
    }
}

As you can see, the WSDL URL has been configured to run on Port 8090. Here is the updated configuration for your reference:

<subsystem xmlns="urn:jboss:domain:webservices:2.0" statistics-enabled="${wildfly.webservices.statistics-enabled:${wildfly.statistics-enabled:false}}">
    <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
    <wsdl-port>8090</wsdl-port>
    <endpoint-config name="Standard-Endpoint-Config"/>
    <endpoint-config name="Recording-Endpoint-Config">
        <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
            <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
        </pre-handler-chain>
    </endpoint-config>
    <client-config name="Standard-Client-Config"/>
</subsystem>

Finally, note that you need to open the WSDL Port in the socket-binding configuration and register it on undertow server.

If you want to run a single HTTP listener in your undertow Web server it is sufficient to change the socket binding of the http listener to “8090” (in our example).

On the other hand, if you want to use multiple HTTP listeners (for example one dedicated to your WSDL Port), we recommend checking this tutorial: How to run multiple HTTP Ports in JBoss / Wildfly

Changing Web Services Port using the Web Console

Another option is to use the Web Admin Console. Connect to it (default address is http://localhost:9990) and select Web Services in the subsystem Configuration.

From there, click on View and Edit the Configuration:

wildfly webservices change port

From there, you can change the WSDL Port attribute or the WSDL Secure Port Attribute.

Changing SOAP Port in JBoss AS 4 and 5

If you are running an older version of JBoss, then you will need to change port information in 3 configuration files:
At first modify server.xml (With JBoss 4.2.X it’s under deploy/jboss-web.deployer):

    <Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />

Next modify jboss-service.xml (under deploy/http-invoker.sar/META-INF/jboss-service.xml )

Modify all attributes named “InvokerURLSuffix” :

<attribute name="InvokerURLSuffix">:8080/invoker/EJBInvokerServlet</attribute>
<attribute name="InvokerURLSuffix">:8080/invoker/JMXInvokerServlet</attribute>
<attribute name="InvokerURLSuffix">:8080/invoker/readonly/JMXInvokerServlet</attribute>

Finally check the jboss-beans.xml (under deploy/jbossws.sar/jbossws.beans/META-INF)

<property name="webServicePort">8080</property>

Conclusion

In conclusion, mastering the art of configuring the default Web Service deployment port is a crucial skill for developers working with SOAP Web services on WildFly or JBoss EAP 7. By delving into the configuration settings of the webservices subsystem and manipulating the wsdl-port or wsdl-secure-port, developers gain the power to customize the deployment port according to their specific requirements.

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