项目中经常用到开发webservice接口,及调用webService接口。这里讲解如何使用cxf开发webService接口。

一、webservice介绍及理解     

       webservice是一种跨平台,跨语言的规范,用于不同平台,不同语言开发的应用之间的交互。 
       比如,平台平台淘宝、京东想获取其他快递公司数据接口,需快递公司开放数据接口。
       那么 webservice就是出于以上类似需求而定义出来的规范;无需关心对方什么平台上开发以及使用何种语言开发。
       只关心调用对方发布webservice接口的一些对我们获取有用数据的方法。
       开发人员一般就是在具体平台开发webservice接口,以及调用webservice接口;每种开发语言都有自己的webservice实现框架。
       比如Java 就有 Apache Axis1、Apache Axis2、Codehaus XFire、Apache CXF、Apache Wink、Jboss  RESTEasyd等等...

        使用cxf开发webservice接口

 

二、cxf

  cxf是java开发webService的一种实现框架技术。目前,cxf是主流的webService实现框架。

      使用cxf开发需引入cxf开发相关jar包,maven项目中pom.xml配置如下:

     

使用cxf开发webservice接口
 1 <!--添加cxf支持  -->
 2     <dependency>
 3         <groupId>org.apache.cxf</groupId>
 4         <artifactId>cxf-rt-frontend-jaxws</artifactId>
 5         <version>3.1.9</version>
 6     </dependency>
 7     <dependency>
 8         <groupId>org.apache.cxf</groupId>
 9         <artifactId>cxf-rt-transports-http-jetty</artifactId>
10         <version>3.1.9</version>
11     </dependency>
12     <dependency>
13         <groupId>org.apache.cxf</groupId>
14         <artifactId>cxf-core</artifactId>
15         <version>3.1.9</version>
16     </dependency>
使用cxf开发webservice接口

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-06-16
  • 2021-08-03
  • 2021-06-17
  • 2021-07-08
猜你喜欢
  • 2021-04-20
  • 2021-10-31
  • 2021-12-03
  • 2021-10-28
相关资源
相似解决方案