我已经像这样构建了一个 CXF Webservice -
界面:
package de.arvato.icssa.services;
import javax.jws.WebService;
@WebService
public interface TestService {
String sayHi(String text);
boolean startProcess(String mail, String processName, String locale);
}
执行:
package de.arvato.icssa.endpoints;
import javax.jws.WebService;
import java.util.*;
import de.arvato.icssa.util.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import de.arvato.icssa.db.HibernateUtil;
import de.arvato.icssa.db.worker.TaskWorker;
import de.arvato.icssa.services.TestService;
@WebService(endpointInterface="de.arvato.icssa.services.TestService")
public class TestServiceImpl implements TestService{
private Log log = LogFactory.getLog(this.getClass());
@Override
public String sayHi(String text)
{
System.out.println("sayHi called");
return "Hello " + text;
}
public boolean startProcess(String mail, String processName, String locale)
{
<<<<<CODE>>>>>>
}
}
cxf.xml:
<?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">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint id="testService"
implementor="de.arvato.icssa.endpoints.TestServiceImpl" address="/TestService" />
</beans>
web.xml 的重要部分:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf.xml</param-value>
</context-param>
<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>/TestService</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/TestService/*</url-pattern>
</servlet-mapping>
这通常工作得很好。我的方法“startProcess”曾经有 2 个参数(省略了“语言环境”)——我最近添加了它,重新启动了我已集成到“服务器”Eclipse 插件中的 Tomcat 6.0 Web 服务器——但该方法仍然只接受 2 个参数并在添加第三个参数之前运行我在该方法中拥有的旧代码。
编辑
如果我实现了另一个方法,它在重新启动服务器后也没有更新,看起来好像没有任何变化。我的 Web 服务仍以其原始形式更新。
关于如何“硬”重新部署该网络服务的任何想法?
谢谢!