ant elder wrote:
I've not yet been able to find any good way to reliably work out the
complete service URL in all environments. What i think maybe the best
approach is to add a getBaseURI method to the Tuscany ServletHost interface
so that can be used by bindings. So then it would be down to each
ServletHost impl to set this  correctly rather than the Axis2 binding to
work it out. So for example for WebappServletHost it would be the webapp url
like, http://localhost:8080/helloworld-ws-service-webapp, for the war distro
http://localhost:8080/tuscany, for Geronimo http://localhost:8080 etc.

Does something like this sound ok or does anyone have any better ideas?

   ...ant


I'm not sure which scenario you have in mind for this, so here are the two use cases I can think of:

(1) A binding was configured with a URI like localhost:8080 but will need to tell the world (in generated WSDL, in service endpoint references etc.) the actual endpoint address at which it can be reached, 192.168.1.1:8080 or myhost:8080 for example

(2) A binding was configured with a URI, but we are not in a position to provide the service at that exact same URI, because we are running in a Webapp deployed at a different URI for example. I don't really like this use case as I think there's issues with this approach and that we should configure the Web container from the SCA metadata, not the other way around, but I guess we have to live with that for now :) Anyway, in that case as well we need to figure the effective URI of the particular service to put it in service endpoint references for example.

For both scenarios, I'd suggest methods like this:

ServletHost.getRequestURI(String mapping) -> giving you the complete URI that people will have to send requests to
or
ServletHost.getServletPath(String mapping) -> giving you the actual URI at which the particular servlet is available

Both methods are modeled after the Servlet API interface, and will give you what you need (assuming I correctly guessed the scenarios you're after) in a simpler way than a getBaseURI() method which would still require the binding to combine that base URI with the rest of the URI that it knows about.

--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to