Answering myself for future reference. See below.

        String domain = "";

        try {
            MessageContext context = MessageContext.getCurrentMessageContext();
            URL url = new URL(context.getTo().getAddress());
            domain = url.getProtocol() + "://" + url.getHost();
            if (url.getPort() > 0) {
                domain += ":" + url.getPort();
            }
        } catch (MalformedURLException e) {
        }


Thanks.


________________________________
From: Jack Sprat <rexclaim...@yahoo.com>
To: "axis-u...@ws.apache.org" <axis-u...@ws.apache.org>
Sent: Friday, September 23, 2011 5:47 PM
Subject: [Aixs2] How to get URL endpoint


This should be an easy one. How do I get the URL endpoint from within the Java 
code?

Thanks.

Reply via email to