On 28/03/12 19:09, Calvert, Zach (Zach)** CTR ** wrote:
I am trying to get a hold of either the camel header "CamelHttpBaseUri" or get the correctly populated 
resource "@Context UriInfo uriInfo" inside of a CamelCXF bean.  I'm able to get the UriInfo, but the baseURI 
exposed out of the UriInfo is "camel://cxfbean:" instead of something like "http://example.com";.  
We are using jetty as the from:
<camel:route>
             <camel:from 
uri="jetty:http://0.0.0.0:{{jetty.port}}/restms/?matchOnUriPrefix=true"; />
             <camel:log message="Message received from jetty"/>
             <camel:to 
uri="cxfbean:restfulService?headerFilterStrategy=#keepAllMessageHeadersStrategy" />
             <camel:log message="Cxfbean handled message"/>
         </camel:route>

I need to get the base URI, so if I reach my server by going to 
http://example.com/rest, I know where the request came from.


Perhaps injecting HttpServletRequest can do a trick ? I think CXF will check for the Message.BASE_PATH for non-CXF destinations, so may be cxfbean processor does not set it and hence UriInfo, not sure right now,


Is this possible?

UriInfo does need to return the actual HTTP address so ideally it should be possible,

Cheers, Sergey



Thanks,
Zach Calvert


Reply via email to