users@jax-rpc.java.net

Re: about JAXRPCServletDelegate and soap address location

From: Alessio Cervellin <alessio.cervellin_at_sun-cs-italy.com>
Date: Thu, 31 Mar 2005 20:25:26 +0200

Doug Kohlert wrote:
> Alessio,
> No that is not possible using the ?WSDL. I believe you could put the
> WSDL in your root context and then retrieve it without the ?WSDL like
> any other public file and the servlet would not process it. I am not
> sure why you would want to do this.

Not a real need, I was just wondering... let's say I've two
endpoints/hosts, HOST_A and HOST_B.
They publish the same service, described by a WSDL:
one contains
<soap address location="http://HOST_A/context/servlet_mapping">
and the other
<soap address location="http://HOST_B/context/servlet_mapping">

A client knows he can get the WSDL just by typing
http://HOST_B/context/servlet_mapping?WSDL
or
http://HOST_A/context/servlet_mapping?WSDL

Now suppose that, for some reason (e.g. maintenance), I want to redirect
all the requests sent to the webservice at HOST_A to the soap address
location of HOST_B.
The 1st thing I would think about would be to modify the WSDL hosted on
HOST_A by changing the soap address location specified within it to
point to HOST_B. This means that if the client asks for the WSDL by
using the already-known URL:
http://HOST_A/context/servlet_mapping?WSDL
It will get instead a WSDL containing the endpoint of HOST_B:
<soap address location="http://HOST_B/context/servlet_mapping">

But due to the actual implementation of
JAXRPCServletDelegate/WSDLPublisher it's not possible since it always
replaces the endpoint url specified in the wsdl with the current
host/context, am I right?

Another scenario would be when I've two copies of the same webservice on
the same host but deployed on diffenrent contexts, and I would like to
switch between them at any moment only by changing the <soap address
location> tag in one of the wsdl (without having to tell the clients to
get it from another location).

Obviously, as you already told, by publishing the wsdl as any other
public file and giving to the clients the exact url to it would resolve
any problem... but I must admit that the "?WSDL" url pattern is for many
customers a well-known, and "aesthetically" appreciated, "url pattern"
to retrieve WSDL (or model.gz) files, maybe better than something like
http://HOST/context/myfile.wsdl