How to let Tomcat publish WSDL for the WS it provides (CXF 2.2, Spring 3, Tomcat6)
- by Zwei Steinen
Hi, I am trying to implement a simple web service provider using Tomcat6, CXF 2.2, Spring 3, and actually the service itself runs fine (I can call web methods using the original WSDL and SoapUI). However, Tomcat returns a blank page on "?wsdl" requests. Also, when I try to manipulate the (would-be) published WSDL by adding a publishedEndpointURL property to the jaxws:endpoint element, Tomcat will issue a XML parse exception (something like property publishedEndpointURL is not allowed in element jaxws:endpoint)
<jaxws:endpoint
id="service"
implementor="org.sample.ServiceImpl"
implementorClass="org.sample.ServiceImpl"
address="/service"
publishedEndpointURL="http://localhost:8080/MyService/service">
I used "contract first" style.
EDIT:
What I did so far:
Setup tomcat6 with Spring3
Generate CXF implementation class by using maven
Provide web.xml (only relevant part shown)
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>cxf</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Provide applicationContext.xml (only relevant part is shown)
Package generated stuff into war and deploy