Actually, the given solution doesn't work anymore. You might get the internal ip address of the appnode.
I've created a mendix incident (206506) on this to retrieve the ip address without using an external service.
their answer is:
If you would like to know the IP address/range of your applications there are two methods: - request the IP address from support, you will be notified within 48 hours before any change takes place - use an external service to discover the current IP as it appears on the Internet.
To find the public Ip adress to whitelist you can make use of an external service like http://ipv4.icanhazip.com/ within a java action to return the ip address to whitelist.
You could file a ticket in the support portal. But because your app is located in the public cloud, it would make no sense to know the ip. Because your app could be located every where, based on the cloud provider mendix uses on the background. Are there other possibilities with your external webservice, else than ip whitelisting?