Search code examples
javasoapwsdltomcat7cxf

CXF : default wsdl path


I run a soap webservice with Tomcat7 and cxf 3.2.1 (on windows 7), if I add a wsdllocation into my cxf-servlet.xml file, I have some errors but without this attribute, cxf found a correct wsdl and my service works fine and it's not exactly My wsdl. It's cool, but how ? Does CXF generate wsdl on runtime ? I can't find any information about "default wsdl" in the documentation... Thanks !


Solution

  • So, after all, found the answer: Yes, CXF generate a default wsdl at runtime. If anyone come from Axis 1.x SOAP definitions, you must add a package-info.java into your API package to have a "elementFormDefault=qualified" into the wsdl types definition (some problems with different clients) see this thread

    If you want to deploy a wsdl, add wsdlLocation into your servlet.xml/jaxws:endpoint definition :

    <jaxws:endpoint xmlns:tns="http://my.service.com" 
        wsdlLocation="/wsdl/MyServiceImpl.wsdl" > 
       <!-- some configuration here -->
    </jaxws>
    

    Root folder is your deployment point.