CXF code first service, WSDL generation; soap:address changes?
Posted
by
jcalvert
on Stack Overflow
See other posts from Stack Overflow
or by jcalvert
Published on 2010-12-22T19:30:22Z
Indexed on
2011/01/04
17:54 UTC
Read the original article
Hit count: 211
I have a simple Java interface/implementation I am exposing via CXF. I have a jaxws element in my Spring configuration file like this:
<jaxws:endpoint id="managementServiceJaxws"
implementor="#managementService" address="/jaxws/ManagementService" >
</jaxws:endpoint>
It generates the WSDL from my annotated interface and exposes the service. Then when I hit http://myhostname/cxf/jaxws/ManagementService?wsdl I get a lovely WSDL. At the bottom in the wsdl:service element, I'll see
<soap:address location="http://myhostname/cxf/jaxws/ManagementService"/>
However, some time a day or so later, with no application restart, hitting that same url produces:
This causes a number of problems, but what I really want is to fix it. Right now, there's a particular client to the webservice that sets the endpoint to localhost; because it runs on the same machine. Is it possible the wsdl is getting regenerated and cached and then exposing the 'localhost' version? In part I don't know the exact mechanism by which one goes from a ?wsdl request in CXF to the response. It seems almost certain that it's retrieving some cached version, given that it's supposed to be determining the address by asking the servletcontainer (Jetty).
For reference I know a stopgap solution is using the hostname on the client and making sure an alias in place so that it goes over the loopback.
EDIT: For reference, I confirmed that if I bring my application up and first hit it over localhost, then querying for the wsdl via the hostname shows the address as localhost. Conversely, first hitting it over the hostname causes localhost requests to show the hostname. So obviously something is getting cached here.
© Stack Overflow or respective owner