find a servlet URL at runtime

I have a web service in one WAR file #1 and a servlet in WAR file #2. Both WARs are deployed in the same EAR. I want to be able to make a request from the web service implementation to the servlet in WAR #2 but in order to do that I need to be able to find the servlet's URL (at least host/IP and port). Is there a way to do this!?

[339 byte] By [cheddarmakermana] at [2007-11-27 10:26:47]
# 1

1: Use localhost or the loopback ip address 127.0.0.1

2: use the java.net.InetAddress class to get the localhost ip address.

3: use the request.getURI to get the URL address of request coming into the web application

tolmanka at 2007-7-28 17:41:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...