云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > axis2与CXF开发webservice的对比

axis2与CXF开发webservice的对比

  • 62 次阅读
  • 3 次下载
  • 2025/12/2 21:07:53

???: Setting the server's publish address to be http://localhost:9000/cxfdemo

2012-12-12 11:29:04 org.eclipse.jetty.util.log.Slf4jLog info ???: jetty-7.4.2.v20110526

2012-12-12 11:29:04 org.eclipse.jetty.util.log.Slf4jLog info ???: Started SelectChannelConnector@localhost:9000 STARTING 2012-12-12 11:29:04 org.eclipse.jetty.util.log.Slf4jLog info ???: started o.e.j.s.h.ContextHandler{,null} Start success

2012-12-12 11:29:04

org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass

???: Creating Service {http://cxfdemo/}CXFDemoService from class cxfdemo.CXFDemo

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.076 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 ... ...

4 在webapp中发布

CXF提供了spring的集成,同时还提供了org.apache.cxf.transport.servlet.CXFServlet用于在web容器中发布WebService。 前面的例子中增加了整个apache-cxf的依赖,所以会自动增加对srping的引用。只需要写beans配置文件和web.xml文件即可。

?

在web.xml中配置CXFServlet

CXFServlet org.apache.cxf.transport.servlet.CXFServlet

CXFServlet /services/*

?

在web.xml中增加spring的ContextLoaderListener并配置context-param

contextConfigLocation

/WEB-INF/cxfdemo-beans.xml org.springframework.web.context.ContextLoaderListener

?

beans配置文件内容如下

cxfdemo-beans.xml

xsi:schemaLocation=\http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd\ >

如此,WebService就已经在web容器中发布了。启动web应用:

$mvn jetty:run

就可以在浏览器中看到已经发布的WebService,如下图:

搜索更多关于: axis2与CXF开发webservice的对比 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

???: Setting the server's publish address to be http://localhost:9000/cxfdemo 2012-12-12 11:29:04 org.eclipse.jetty.util.log.Slf4jLog info ???: jetty-7.4.2.v20110526 2012-12-12 11:29:04 org.eclipse.jetty.util.log.Slf4jLog info ???: Started SelectChannelConnector@localhost:9000 STARTING 2012-12-12 11:29:04 org.eclipse.jetty.util.log.Slf4jLog info ???: started o.e.j.s.h.ContextHandl

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com