I am trying to set up a simple HelloWorld apache CXF webservice in eclipse/maven. I have a web.xml, cxf-servlet.xml in webapp/WEB-INF. But when I enter my request :http://localhost:8080/WebServiceCXFTest/services/HelloWorld
I get:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for
http://schemas.xmlsoap.org/wsdl/soap/
My cxf-servlet.xml is as follows:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint
id="helloWorld"
implementor="com.lifescan.dmt.services.HelloWorldImpl"
address="/HelloWorld" />
</beans>
HelloWorldImpl:
package com.lifescan.dmt.services;
import javax.jws.WebService;
@WebService(endpointInterface = "com.lifescan.dmt.services.HelloWorld",
serviceName = "HelloWorld")
public class HelloWorldImpl implements HelloWorld {
public
String sayHi(String text) {
System.out.println("sayHi called");
return "Hello " + text;
}
}
package com.lifescan.dmt.services;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService
public interface HelloWorld {
String sayHi(@WebParam(name="text") String text);
}
Any help is greatly appreciated. Thanks so much in advance.