web.xml中配置:
[code="java"]
XFireServlet
org.codehaus.xfire.transport.http.XFireConfigurableServlet
<servlet-mapping>
<servlet-name>XFireServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping> [/code]
service.xml配置
[code="java"]<?xml version="1.0" encoding="UTF-8"?>
HelloService
http://localhost:8080/xfireTest
com.test.HelloWord
com.test.HelloWordImpl
[/code]
HelloWordImpl.java代码
[code="java"]package com.test.impl;
import com.test.HelloWord;
public class HelloWordImpl implements HelloWord {
public String hello(String name) {
if(null == name){
return "Hello Guest";
}
return "Hello "+name;
}
}[/code]
例子
[url]http://www.cnblogs.com/zhangchaoyang/articles/1954846.html[/url]
参见:
[url]http://xiaosa.blog.51cto.com/665033/184109/[/url]
[url]http://www.blogjava.net/tscfengkui/archive/2011/02/25/345134.html[/url]
service.xml配置错了
[code="java"]<?xml version="1.0" encoding="UTF-8"?>
HelloService
http://localhost:8080/xfireTest
com.test.HelloWord
com.test.HelloWordImpl
[/code]
http://localhost:8080/xfireTest
改成
http://localhost:8080/HelloService
访问下wsdl看看:
http://localhost:8080/HelloService?wsdl
具体可参考:
[url]http://zw-kindsoft-cn.iteye.com/blog/369602[/url]