Basic Web Service Question

Hello, I am researching Web services as an alternative technology for my organization to a proprietary request/response model we are using now. Forgive me if my question sounds basic, but I've googled just about every keyword I could think of to get the answer but couldn't. From what I've read so far of Java web services for Java EE, I see a potential problem in implementing it in my organization's architecture.

In writing clients to the web service, it seems you can either put the service location as either an annotation in code, or by generating stub files. In both cases you have an absolute URL coded somewhere. How does this work in an environment where there are "Test" servers and "Production" servers. It appears you can't "flip the switch" from test to production without changing annotations/re-generating the stub files to look to the production server. Is Dynamic client invocation the only answer to this, or is there some elegant mechanism already built in that handles this scenario? Thanks for your answer.

[1047 byte] By [bryan4587a] at [2007-11-26 17:52:48]
# 1
Use AXIS frame work which would be easy for u to develop and test webservices..regardsShanu
mshanua at 2007-7-9 5:05:45 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Using JAX-WS you don't need to regenerate your client all you really need to do is set the appropriate address propety on the proxy/stub you have created. You can easily write code so that this address can be read from a config file if necessary.

Check out JAX-WS at http://jax-ws.dev.java.net.

Thanks

dkohlerta at 2007-7-9 5:05:45 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

We control these test, stage and production URLs in one of our database configuration table, do the configuration whatever the way you want but at run time provide the url at the time of invoking the Web services method.

Here is some sample so that you may get some idea.

String url = confObj.getURL();

FooSoapBindingStub stub = (FooSoapBindingStub) new FooServicesLocator().getFooServicesPort(new URL(url));

//If necessary

stub.setUsername(userName);

stub.setPassword(password);

apk2072a at 2007-7-9 5:05:45 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...