• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a Web Service know where itself is deployed??  RSS feed

 
Guadalupe Ortiz
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web service developed with jaxrpc. I can deploy it anywhere. Can the web service know at run time where it has been deployed? Because I can even deploy it, the same service, in two different uris, can it distinguish in which uri its operations are invoked??
If possible, can you tell me how, please?
Any opinion is grateful
Gobellot
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every webservice is identified/located and invoked by their endpoint address. Your client will use this endpoint, by that way you can tell which service you are accessing.
Does that help ? If not can you re-frame your question again.?
 
Guadalupe Ortiz
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will try to be clearer in my questuion. I know the client know the endpoint where it access to invoke the service, but does the service itself knows where it has been deployed?
For instance, suposse I have a service deployed in two endpoints (a simple example, the hello world), but the service behaves different if it is invoked in one of the endpoints or in the other one (for example, it can say "hello" in two different languages depending on the endpoint where it has been invoked -so you only need and if structure and not two different services for something very similar) How does the service know in which of the two endpoints where it has been deployed, it has been invoked.
Hopes this clarify my doubt; any idea about it?
Gobellot
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't this be handled by the deployment/build process rather than decided at runtime by the service itself?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!