views:

593

answers:

1

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"&gt;

I used "contract first" style.

EDIT: What I did so far:

1.Setup tomcat6 with Spring3
2.Generate CXF implementation class by using maven
3.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>
</web-app> 

4.Provide applicationContext.xml (only relevant part is shown)

<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

<jaxws:endpoint
        id="service"
        implementor="org.sample.ServiceImpl"
        implementorClass="org.sample.ServiceImpl"
        address="/service"/>

5.Package generated stuff into war and deploy

A: 

Turns out I wasn't seeing the WSDL because I was using Chrome. When viewed in Firefox, it displayed the WSDL.

Also, endpointURL worked when changed to endpointUrl (documentation error in CXF website).

Enno Shioji
Ctrl + U = view source
matt b