译者(kaiwii)注:原文位置:
http://cxf.apache.org/docs/why-cxf.html
With so many options available to developers today in the web services space, one of the questions worth asking is why should I use CXF? In no particular order, here are some of the reasons you might want to use CXF:
翻译:
在web services的众多技术中,为什么选择cxf,原因如下:
CXF implements the JAX-WS APIs which make building web services easy. JAX-WS encompasses many different areas:
· Generating WSDL from Java classes and generating Java classes from WSDL
· Provider API which allows you to create simple messaging receiving server endpoints
· Dispatch API which allows you to send raw XML messages to server endpoints
· Much more...
翻译:
JAX-WS支持
cxf实现了JAX-WS的众多api,使得web services的建立不再是一件难事。JAX-WS包括了以下的很多不同的部分:
1、实现WSDL与java类之间的自动转换(关于wsdl是什么,可以留意本人的转载的另一篇文章:http://blog.youkuaiyun.com/kaiwii/article/details/6883475)
2、Provider api提供一些方法,使得你可以在服务器的端口中接收一些简单的消息
3、Dispatch api通过了一些方法,使得你可以将简单的xml格式的信息发送到服务器的端口中
……
Spring is a first class citizen with Apache CXF. CXF supports the Spring 2.0 XML syntax, making it trivial to declare endpoints which are backed by Spring and inject clients into your application.
翻译:
与Spring框架的集成
Spring框架是第一个支持Apache CXF的。CXF支持Spring 2.0 xml的语法,使得声明Spring所支持的端口和将客户端集成到web应用中的工作变得很容易。
Aegis Databinding
Aegis Databinding (2.0.x) is our own databinding library that makes development of code-first web services incredibly easy. Unlike JAXB, you don't need annotations at all. It also works correctly with a variety of datatypes such as Lists, Maps, Dates, etc. right out of the box. If you're building a prototype web services that's really invaluable as it means you have to do very little work to get up and running (and one of the primary reasons XFire was started a while back)
翻译:
Aegis Databinding (2.0.x)是我们自己的databinding library(databinding:实现xml与对象之间的映射,具体可以参见: http://blog.youkuaiyun.com/kaiwii/article/details/6883704),使得通过代码来开发web services的工作变得十分简单。但是,与JAXB不同的是,你不需要使用注释的方式。同时,你可以使用大量不同的数据类型,例如Lists, Maps, Dates等。如果,你准备开发一个原型web services,你就只需要做很少工作就能使这个web services运行起来。
RESTful services
CXF enables the development of RESTful services via annotations using the HTTP Binding. Using URI templates and annotations you can bind a service operation to arbitrary URL/verb combinations. For instance, you can annotate a getCustom method with @Get @HttpResource("/customers/{id}"). CXF will then listen for GET requests on that URL and using the parameter at the {id} location as a parameter to the service.
翻译:
Cxf支持使用Http binding的注释的方式来开发RESTful服务。使用uri模板和注释,你可以将某个service的操作捆绑到任何一个URL/verb的组合之中。例如,你用@Get @HttpResource("/customers/{id}")来注释getCustom的方法,cxf将会侦探来自于这个URL的所有GET请求,然后把{id}位置对应的值作为一个参数发送到这个服务中。
WS-* Support
CXF supports a variety of web service specifications including WS-Addressing, WS-Policy, WS-ReliableMessaging and WS-Security.
翻译:
CXF支持大量不同的web service规范,例如:WS-Addressing, WS-Policy, WS-ReliableMessaging 和WS-Security.