cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <ja...@carmanconsulting.com>
Subject Re: Getting Full Address of Server?
Date Tue, 23 May 2017 13:46:49 GMT
That's what I figured.  Just thought I'd check in with the experts.  If I
were to want to provide a patch, do you even think it's possible?

On Tue, May 23, 2017 at 9:33 AM Sergey Beryozkin <sberyozkin@gmail.com>
wrote:

> Right, if the endpoint address is relative (=> Servlet transport) then
> CXF does not know until the runtime what the container host, port or
> context is
>
> Sergey
>
>
> On 23/05/17 14:02, James Carman wrote:
> > I tried various attempts at getting what need:
> >
> > final Server server = sf.create();
> >
> > if(server.getDestination() instanceof AbstractHTTPDestination) {
> >    AbstractHTTPDestination httpDestination =
> > (AbstractHTTPDestination)server.getDestination();
> >    LOGGER.info("publishedEndpointUrl: {}",
> > httpDestination.getEndpointInfo().getProperty("publishedEndpointUrl"));
> >    LOGGER.info("AbstractHTTPDestination.getPath(): {}",
> > httpDestination.getPath());
> >    LOGGER.info("AbstractHTTPDestination.getServer().getRedirectURL():
> {}",
> > httpDestination.getServer().getRedirectURL());
> > }
> >
> LOGGER.info("server.getDestination().getAddress().getAddress().getValue():
> > {}", server.getDestination().getAddress().getAddress().getValue());
> > LOGGER.info("server.getEndpoint().getEndpointInfo().getAddress(): {}",
> > server.getEndpoint().getEndpointInfo().getAddress());
> >
> >
> > Which only yielded:
> >
> >
> > 2017-05-23T09:00:57,340 | INFO | pool-40-thread-1 |
> > DefaultJaxrsServerFactory | 140 - org.microbule.core - 0.3.0.SNAPSHOT |
> > publishedEndpointUrl: null
> > 2017-05-23T09:00:57,340 | INFO | pool-40-thread-1 |
> > DefaultJaxrsServerFactory | 140 - org.microbule.core - 0.3.0.SNAPSHOT |
> > AbstractHTTPDestination.getPath(): /hello
> > 2017-05-23T09:00:57,341 | INFO | pool-40-thread-1 |
> > DefaultJaxrsServerFactory | 140 - org.microbule.core - 0.3.0.SNAPSHOT |
> > AbstractHTTPDestination.getServer().getRedirectURL(): null
> > 2017-05-23T09:00:57,342 | INFO | pool-40-thread-1 |
> > DefaultJaxrsServerFactory | 140 - org.microbule.core - 0.3.0.SNAPSHOT |
> > server.getDestination().getAddress().getAddress().getValue(): /hello
> > 2017-05-23T09:00:57,342 | INFO | pool-40-thread-1 |
> > DefaultJaxrsServerFactory | 140 - org.microbule.core - 0.3.0.SNAPSHOT |
> > server.getEndpoint().getEndpointInfo().getAddress(): /hello
> >
> >
> > On Tue, May 23, 2017 at 3:27 AM Dennis Kieselhorst <deki@apache.org>
> wrote:
> >
> >>> Is there a way to ascertain the full address of a server created with
> >>> JAXRSServerFactoryBean?  For example, if I only set the address to
> >> "/foo",
> >>> is there any way to know that the full address is actually "
> >>> http://10.1.1.1/cxf/foo"?
> >>
> >> You can get the Address from EndpointInfo or use the
> publishedEndpointUrl
> >> property.
> >>
> >> Regards
> >> Dennis
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message