读书人

Spring配备方式使用CXF开发WebService

发布时间: 2012-09-10 11:02:32 作者: rapoo

Spring配置方式使用CXF开发WebService竟如此的简单

CXF与Spring做了集成,所以可以充分使用上Spring优点,让开发使用WebService是如些的美妙.怎么写WebSerivce接口,实现类在这不做重复,重点说下如何发布,及使用.

? 服务端的发布:

beans.xml

?web.xml

?

发布后可查看到:

http://localhost:8080/UserWs?wsdl

http://localhost:8080/ProductWs?wsdl

发布成功!

?

客户端的使用:

cxf-webservice-client.xml

?

ApplicationContext context = ...; // your Spring ApplicationContext
UserWs?userWs = (UserWs?) context.getBean("userWs");

?

读书人网 >Web前端

热点推荐