You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Christopher McCurdy <mc...@engr.orst.edu> on 2004/07/27 20:18:27 UTC

Server URL

Greetings,

I have a web-service that.s behind multiple redirectors (load balancers, 
external tiers).  When I generate my WSDL file, the targetNamespace is the 
URL of the machine where the soap servlet is.   Is there a way to 
configure (like say the server-config.wsdd) to point it at the correct 
external URL?  I could generate a static servlet.wsdl, and modify the 
targetNamespace, but that seems like a maintenance headache.

Thanks,

Chris


Re: Multiple deployments

Posted by Jason Etherton <je...@astro.livjm.ac.uk>.
Thanks very much!!!

Anand Natrajan wrote:

>The java2wsdl that requires a location generates a static, "compile-time"
>WSDL file that you can use to generate server skeletons (using wsdl2java).
>The skeletons generated do NOT contain machine-specific code. Once you've
>filled in the skeletons, you can discard that WSDL file if you like because
>Axis can generate a new one for your service on demand.
>
>MyWebServiceLocator.java is a client-side stub. Yes, it's unfortunate that
>when you run wsdl2java, Axis dumps the client-side stubs as well as the
>server-side skeletons in the same directory - not too fond of that. However,
>moving past that, the locator file is something your clients will use when
>they access the "run-time" WSDL from the machine(s) where you have deployed
>your service. Since it's the clients who are using the locator, yes, it
>contains the name of the machine, but that's okay. (As an aside, in my
>build.xml I actually regexpreplace that very line to do a lookup into a
>properties file, thus making the stubs also a bit more dynamic.)
>
>Anand
>
>On Fri, 30 Jul 2004, Jason Etherton wrote:
>
>: Thanks, but what about:
>:
>: 1) the java2wsdl requiring a location
>:
>: 2) the MyWebserviceServiceLocator.java that is generated - it has the
>: location of the service as a public final String?
>:
>: Jason
>:
>: Anand Natrajan wrote:
>:
>: >Jason,
>: >
>: >Axis does not require recompilation. If your application itself requires the
>: >hostname, that's a different issue.
>: >
>: >Let's say you develop your webservices on the machine batman. When doing so,
>: >you will write Java interface/classe, java2wsdl them to get a WSDL,
>: >wsdl2java that to get a WSDD and server skeletons. You will fill in the
>: >skeletons - all code non-specific to batman. Then you will either paste the
>: >deploy.wsdd got from wsdl2java into batman's Axis's server-config.wsdd or
>: >you will start up the app server on batman, deploy Axis within and deploy
>: >deploy.wsdd. The latter effectively does the former, i.e., pastes into
>: >server-config.wsdd.
>: >
>: >So far so good, you've deployed on batman. But now you want to deploy on the
>: >machine spiderman as well. You don't have to recompile. All you have to do
>: >is take your axis.war directory/file from batman and copy it over to
>: >spiderman (assuming the jars for your application are inside axis.war's lib
>: >directory). The WSDDs in question are NOT machine-specific, therefore by
>: >doing so, you have deployed on spiderman as well.
>: >
>: >How to check? Go to http://spiderman:8080/axis and drill your way down to
>: >the WSDL for your service. You should clearly see the SOAP address point to
>: >spiderman, not batman. You're set.
>: >
>: >Anand
>: >
>: >On Fri, 30 Jul 2004, Jason Etherton wrote:
>: >
>: >: Just a quickie folks, I need to deploy the same webservice onto many
>: >: different servers, so my question is:
>: >:
>: >: Do I have to recompile my code for every server with an 'ant
>: >: -Dserver.hostname=my.server.com'-type compilation, using the
>: >: server.hostname property in the java2wsdl Ant script, or is there
>: >: another (simpler) way?
>: >:
>: >: Thanks.
>: >:
>: >: As a small aside, why does the '-p' option (the new package into which
>: >: the generated source files are placed) not exist in the Ant wsdl2java task?
>: >:
>: >: Jason
>: >
>: >
>: >
>:
>
>  
>

Re: Multiple deployments

Posted by Anand Natrajan <an...@cs.virginia.edu>.
The java2wsdl that requires a location generates a static, "compile-time"
WSDL file that you can use to generate server skeletons (using wsdl2java).
The skeletons generated do NOT contain machine-specific code. Once you've
filled in the skeletons, you can discard that WSDL file if you like because
Axis can generate a new one for your service on demand.

MyWebServiceLocator.java is a client-side stub. Yes, it's unfortunate that
when you run wsdl2java, Axis dumps the client-side stubs as well as the
server-side skeletons in the same directory - not too fond of that. However,
moving past that, the locator file is something your clients will use when
they access the "run-time" WSDL from the machine(s) where you have deployed
your service. Since it's the clients who are using the locator, yes, it
contains the name of the machine, but that's okay. (As an aside, in my
build.xml I actually regexpreplace that very line to do a lookup into a
properties file, thus making the stubs also a bit more dynamic.)

Anand

On Fri, 30 Jul 2004, Jason Etherton wrote:

: Thanks, but what about:
:
: 1) the java2wsdl requiring a location
:
: 2) the MyWebserviceServiceLocator.java that is generated - it has the
: location of the service as a public final String?
:
: Jason
:
: Anand Natrajan wrote:
:
: >Jason,
: >
: >Axis does not require recompilation. If your application itself requires the
: >hostname, that's a different issue.
: >
: >Let's say you develop your webservices on the machine batman. When doing so,
: >you will write Java interface/classe, java2wsdl them to get a WSDL,
: >wsdl2java that to get a WSDD and server skeletons. You will fill in the
: >skeletons - all code non-specific to batman. Then you will either paste the
: >deploy.wsdd got from wsdl2java into batman's Axis's server-config.wsdd or
: >you will start up the app server on batman, deploy Axis within and deploy
: >deploy.wsdd. The latter effectively does the former, i.e., pastes into
: >server-config.wsdd.
: >
: >So far so good, you've deployed on batman. But now you want to deploy on the
: >machine spiderman as well. You don't have to recompile. All you have to do
: >is take your axis.war directory/file from batman and copy it over to
: >spiderman (assuming the jars for your application are inside axis.war's lib
: >directory). The WSDDs in question are NOT machine-specific, therefore by
: >doing so, you have deployed on spiderman as well.
: >
: >How to check? Go to http://spiderman:8080/axis and drill your way down to
: >the WSDL for your service. You should clearly see the SOAP address point to
: >spiderman, not batman. You're set.
: >
: >Anand
: >
: >On Fri, 30 Jul 2004, Jason Etherton wrote:
: >
: >: Just a quickie folks, I need to deploy the same webservice onto many
: >: different servers, so my question is:
: >:
: >: Do I have to recompile my code for every server with an 'ant
: >: -Dserver.hostname=my.server.com'-type compilation, using the
: >: server.hostname property in the java2wsdl Ant script, or is there
: >: another (simpler) way?
: >:
: >: Thanks.
: >:
: >: As a small aside, why does the '-p' option (the new package into which
: >: the generated source files are placed) not exist in the Ant wsdl2java task?
: >:
: >: Jason
: >
: >
: >
:

Re: Multiple deployments

Posted by Jason Etherton <je...@astro.livjm.ac.uk>.
Thanks, but what about:

1) the java2wsdl requiring a location

2) the MyWebserviceServiceLocator.java that is generated - it has the 
location of the service as a public final String?

Jason

Anand Natrajan wrote:

>Jason,
>
>Axis does not require recompilation. If your application itself requires the
>hostname, that's a different issue.
>
>Let's say you develop your webservices on the machine batman. When doing so,
>you will write Java interface/classe, java2wsdl them to get a WSDL,
>wsdl2java that to get a WSDD and server skeletons. You will fill in the
>skeletons - all code non-specific to batman. Then you will either paste the
>deploy.wsdd got from wsdl2java into batman's Axis's server-config.wsdd or
>you will start up the app server on batman, deploy Axis within and deploy
>deploy.wsdd. The latter effectively does the former, i.e., pastes into
>server-config.wsdd.
>
>So far so good, you've deployed on batman. But now you want to deploy on the
>machine spiderman as well. You don't have to recompile. All you have to do
>is take your axis.war directory/file from batman and copy it over to
>spiderman (assuming the jars for your application are inside axis.war's lib
>directory). The WSDDs in question are NOT machine-specific, therefore by
>doing so, you have deployed on spiderman as well.
>
>How to check? Go to http://spiderman:8080/axis and drill your way down to
>the WSDL for your service. You should clearly see the SOAP address point to
>spiderman, not batman. You're set.
>
>Anand
>
>On Fri, 30 Jul 2004, Jason Etherton wrote:
>
>: Just a quickie folks, I need to deploy the same webservice onto many
>: different servers, so my question is:
>:
>: Do I have to recompile my code for every server with an 'ant
>: -Dserver.hostname=my.server.com'-type compilation, using the
>: server.hostname property in the java2wsdl Ant script, or is there
>: another (simpler) way?
>:
>: Thanks.
>:
>: As a small aside, why does the '-p' option (the new package into which
>: the generated source files are placed) not exist in the Ant wsdl2java task?
>:
>: Jason
>
>  
>

Re: Multiple deployments

Posted by Anand Natrajan <an...@cs.virginia.edu>.
Jason,

Axis does not require recompilation. If your application itself requires the
hostname, that's a different issue.

Let's say you develop your webservices on the machine batman. When doing so,
you will write Java interface/classe, java2wsdl them to get a WSDL,
wsdl2java that to get a WSDD and server skeletons. You will fill in the
skeletons - all code non-specific to batman. Then you will either paste the
deploy.wsdd got from wsdl2java into batman's Axis's server-config.wsdd or
you will start up the app server on batman, deploy Axis within and deploy
deploy.wsdd. The latter effectively does the former, i.e., pastes into
server-config.wsdd.

So far so good, you've deployed on batman. But now you want to deploy on the
machine spiderman as well. You don't have to recompile. All you have to do
is take your axis.war directory/file from batman and copy it over to
spiderman (assuming the jars for your application are inside axis.war's lib
directory). The WSDDs in question are NOT machine-specific, therefore by
doing so, you have deployed on spiderman as well.

How to check? Go to http://spiderman:8080/axis and drill your way down to
the WSDL for your service. You should clearly see the SOAP address point to
spiderman, not batman. You're set.

Anand

On Fri, 30 Jul 2004, Jason Etherton wrote:

: Just a quickie folks, I need to deploy the same webservice onto many
: different servers, so my question is:
:
: Do I have to recompile my code for every server with an 'ant
: -Dserver.hostname=my.server.com'-type compilation, using the
: server.hostname property in the java2wsdl Ant script, or is there
: another (simpler) way?
:
: Thanks.
:
: As a small aside, why does the '-p' option (the new package into which
: the generated source files are placed) not exist in the Ant wsdl2java task?
:
: Jason

Multiple deployments

Posted by Jason Etherton <je...@astro.livjm.ac.uk>.
Just a quickie folks, I need to deploy the same webservice onto many 
different servers, so my question is:

Do I have to recompile my code for every server with an 'ant 
-Dserver.hostname=my.server.com'-type compilation, using the 
server.hostname property in the java2wsdl Ant script, or is there 
another (simpler) way?

Thanks.

As a small aside, why does the '-p' option (the new package into which 
the generated source files are placed) not exist in the Ant wsdl2java task?

Jason