You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Laurent Michenaud <lm...@adeuza.com> on 2009/11/09 13:57:27 UTC

testing wsdl generation

Hi,

I would like to write a junit test for testing
the generated wsdl of a spring service.

Thanks for your help.

Re: testing wsdl generation

Posted by Daniel Kulp <dk...@apache.org>.
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
dkulp@apache.org
http://www.dankulp.com/blog