Cxf开发webservice时遇到Can't find the request for xx's Observer
最近在用CXF开发web service时遇到这个很郁闷的问题。第一次用CXF,先说说我的配置吧。
web.xml文件中
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
cxf配置文件中
<?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- CXF webservice配置 -->
<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" />
<bean id="fyqqRespServiceImpl" class="com.thunisoft.fy.gxpt.server.webservice.service.impl.FyqqRespServiceImpl"/>
<jaxws:endpoint
id="fyqqResp"
implementor="#fyqqRespServiceImpl"
address="/fyqqResp" ></jaxws:endpoint>
</beans>
接口:
@WebService
public interface IFyqqRespService {
public String getRespXML(@WebParam(name="cbr")int cbr) throws ParseException;
}
实现类:
@WebService(endpointInterface = "com.thunisoft.fy.gxpt.server.webservice.service.IFyqqRespService")
public class FyqqRespServiceImpl extends GXPTBaseService implements IFyqqRespService {
}
http://localhost:8888/FyServer/fyqqResp?wsdl 这样访问时,报404,控制台报
Can't find the request for http://localhost:8888/FyServer/fyqqResp's Observer;
http://localhost:8888/FyServer/这样访问时,报
No services have been found.
希望高手们帮帮忙吧!我刚开始以为是JAR 包的问题,一朋友帮做了个例子,可以正常访问。然后我把我系统里的JAR包全拷到那个例子里面还是可以正常访问,但我把例子里的JAR包拷到我的项目里面仍然是同样的错儿。由于我们的web.xml配了一些listener,而且url-pattern全是/*,朋友猜可能是这个的问题,但我把配置注释了还是同样的错误。