users@jax-rpc.java.net

Re: Can a Web Service know where itself is deployed??

From: Guadalupe Ortiz <gobellot_at_hotmail.com>
Date: Sun, 9 May 2004 22:17:27 +0200

Yes, I know how to deploy the service in two different context, but once the
service is deployed how does it knows the context where it has been
deployed. For example, suppose I develope the hello world and deploy it in
two different endpoints, depending on the endpoint where it is invoked I
want it to say hello world in different languages, but I am still using the
same service, something like:

public class HelloImpl implements HelloIF{


    public String sayHello() {
      if (myendpoint== "\English")
         return "hello world";
      else if (myendpoint=="\Spanish");
         return "hola mundo";
    }


How do I know "myendpoint" in that point if it is the same service deployed
in two different end`points or contexts??
Thanks
Gobellot

----- Original Message -----
From: "Bobby Bissett" <Robert.Bissett_at_Sun.COM>
To: <users_at_jax-rpc.dev.java.net>
Sent: Sunday, May 09, 2004 6:31 PM
Subject: Re: Can a Web Service know where itself is deployed??


> > 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?
>
> If you're talking about just deploying it and creating client stubs that
> do the right thing, then this is all done for you already. Just deploy
> and go.
>
> With the JAX-RPC SI, the address in the wsdl is generated when you query
> the service for the wsdl. For instance, your config file for wscompile
> might specify a location as http://host/a/b?WSDL. The jaxrpc servlet
> will pull the "http://host/a/b" part out of the request and use it to
> fix the address lines in the wsdl. As a test, you can bring up a local
> server and try both "actual-host-name" and "localhost" in a web browser
> and look at the wsdls -- they will use the location you give them.
>
> Cheers,
> Bobby
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net