'Jboss wildfly is using default docker default address instead of server address when doing soap requests

I'm using Jboss wildfly to serve a soap service. I have deployed it to the server using docker. When providing a URL for the WSDL my server address of 10.1.20.31, the server works fine. But when trying to test the SOAP endpoint with SOAP UI the address I'm getting is http://172.17.0.2 (after importing the wsdl) which is the default docker IP and makes the SOAP endpoint unusable. I've tried creating a network with the docker network command, I've tried providing the in the standalone.xml but with no success.



Solution 1:[1]

This solution is not very well documented. You have to modify the conf of the web services module in (your standalone-*.xml file) in order to allow on-the-fly modification of the hostname:

The doc says:

If wsdl-host is set to jbossws.undefined.host, JBossWS uses the requester's host when rewriting the soap:address

This means concretely:

<!-- This might be something different from ":1.2" depending on your WF version -->
<subsystem xmlns="urn:jboss:domain:webservices:1.2">
    <modify-wsdl-address>true</modify-wsdl-address>
    <wsdl-host>jbossws.undefined.host</wsdl-host>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TacheDeChoco