users@glassfish.java.net

Re: How to get endpoint URL from ServletContext

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Mon, 15 Mar 2010 09:29:07 -0700

Farrukh Najmi wrote:
>
> Here is what I have learned so far...
>
> If I want to get the precise protocol and port I have to get it from
> the ServletRequest not the ServletContext. reason is, as Jan said this
> is request specific an may vary from one request to another.
>
> With spring-ws it is fairly straightforward to get this once a request
> is being processed:
>
> TransportContext tc =
> TransportContextHolder.getTransportContext();
> WebServiceConnection wc = tc.getConnection();
> URI uri = wc.getUri();
>
> Viola! the URI has exactly what I need :-)
>
> Thanks very much Jan.
>

Excellent! :)

Jan