第一范文网 - 专业文章范例文档资料分享平台

axis2与CXF开发webservice的对比

来源:用户分享 时间:2025/5/20 7:50:58 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

???: 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的对比 的文档
axis2与CXF开发webservice的对比.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c75dje89juj9vfqx3d4pq7px008twst015ct_2.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top