this is indeed not so trivial as you could think, at least I did not find an easy way. You can ask the application to get the name of itself, ask the WOAdaptor for the adaptor part, but you cannot find out the name of the server, especially if your installation is behind a firewall or proxy and the external server name is different from the internal name.
We finally used a custom configuration parameter to get the server name (including the adaptor path) and startet from there on, something like:
url = servername + applicationname + ".woa/wa/" + yourActionName