Reputation: 2049
Answer: I know this is not the kind of thing that goes well as far as resolutions go, but I fiddled around with the web.xml and servlet.xml files, and for some reason, it works now, I can get the service list and wsdl files just fine now. I compared my new files to the old ones written below, and the only differences is that the web.xml has the name CXFServlet instead of LoginService, and I have given the cxfservlet.xml endpoint an address now.
I have a issue where I have (Finally) made a CXF webservice deploy on Tomcat. Or, rather, it does start, and it does not produce any warnings or exceptions in the tomcat log when I deploy and redeploy. The problem is that I can't retrieve the WSDL of the service in question. I am beginning to think that I don't understand the web.xml and cxf.xml files as well as I thought.
When I write http://localhost:8080/services/Login?wsdl I would expect the WSDL to pop up, but all I get is a 404. What am I doing wrong? As I said I am not getting any exceptions, so what is my problem?
Edit: Due to some helpful feedback (that I remembered to mark as helpful) I realized that I might have set the context path wrong in my web.xml. I deploy the service through the manager app in tomcat in a file called LoginService.war. This begs the question: Can I even do that? Will tomcat know to look for the CXFServlet class in the LoginService lib, or will it look in the ROOT? Do I need to reconfigure the server to allow me to run from http://localhost:8080/LoginService?
web.xml
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>LoginService</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:metadata/Login/cxfservlet.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>LoginService</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginService</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
</web-app>
cxfservlet.xml
<beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org
/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint id="LoginService"
implementor="orgserver.services.Login" wsdlLocation="WEB-INF/LoginService.wsdl"
address="/">
</jaxws:endpoint>
</beans>
Upvotes: 1
Views: 23276
Reputation: 24047
You shouldn't need to set wsdlLocation unless there is another way to get to your service besides http://localhost:8080/services/. Also wsdlLocation would be a URL.
I'm assuming that you have deployed your app to ROOT.war (root context) in Tomcat since there is no context path before /services.
What is displayed when you browse to http://localhost:8080/services (no trailing /)? It should give you a list of services available, including the WSDL address. If you mouse over the WSDL address it will show you the actual URL.
Upvotes: 5