标签:
<?xml version="1.0" encoding="UTF-8"?> <!-- beans xmlns="http://xfire.codehaus.org/config/1.0">--> <beans> <service xmlns="http://xfire.codehaus.org/config/1.0"> <!-- webService服务的名称 --> <name>HelloWorld</name> <namespace>http://xfireTest/HelloWorldService</namespace> <!-- 自己所写的接口路径 --> <serviceClass> xfireTest.HelloService </serviceClass> <!-- 实现类路径 --> <implementationClass> xfireTest.HelloWorldServiceImpl </implementationClass> </service> </beans>
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>xfireTest</display-name> <description> 使用eclipse和maven搭建基于XFire框架发布Web服务的例子 </description> <servlet> <servlet-name>XFireServlet</servlet-name> <servlet-class> org.codehaus.xfire.transport.http.XFireConfigurableServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>XFireServlet</servlet-name> <url-pattern>/servlet/XFireServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>XFireServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> </web-app>
package xfireTest; public interface HelloService { /** * Hello 方法声明了 Web 服务对外暴露的接口 * * @return 返回给客户端的字符串 */ public String Hello(); }
package xfireTest; public class HelloWorldServiceImpl implements HelloService { /* * Hello 方法为 HelloWorldService 服务接口定义的 sayHello 方法提供具体实现 */ public String Hello() { return "HelloWorld!"; } }
警告: Failed to scan JAR [file:/D:/eclipseWorkspace1/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/webapps/xfireTest/WEB-INF/lib/XmlSchema-1.1.jar] from WEB-INF/lib java.util.zip.ZipException: zip file is empty
标签:
原文地址:http://blog.csdn.net/tuzongxun/article/details/51596565