On Mon November 9 2009 7:57:27 am Laurent Michenaud wrote: > I would like to write a junit test for testing > the generated wsdl of a spring service. > > Thanks for your help.
This kind of depends on how "involved" you want your test to be and what you are trying to test. If you can get the cxf "Server" object for your service (more in a sec), we have a org.apache.cxf.test.TestUtilities class that has a getWSDLDefinition(Server) method that would return the wsdl as wsdl4j Definition or getWSDLDocument(Server) as a DOM. To get the Server object, there are a bunch of options. You could cast the object from the Spring ApplicationContext to an EndpointImpl (if jaxws:endpoint) and dig in there. You can call the TestUtilities.getServerForService(..) (if you set the bus in TestUtilities). You could create your own server with the JAXWSServerFactory. Etc.... -- Daniel Kulp [email protected] http://www.dankulp.com/blog
