Sunday, January 2, 2011

C X F - Web Services

Apache CXF Project was created by the merger of the Celtix and XFire projects. These two projects were merged by folks working together at the Apache Software Foundation.

Apache CXF is a free and open source project, and a fully featured Webservice framework.
It helps you building webservices using different front-end API's, like as JAX-RS and JAX-WS.
Services will talk different protocols such as SOAP, RESTful HTTP, CORBA & XML/HTTP and work with different transports like JMS, HTTP or JBI.

You need to download:
    JDK 6
    Eclipse 3.7
    CXF-2.7.3
    Tomcat 7

Following jar must be in classpath:
    aopalliance-1.0.jar
    commons-logging-1.1.1.jar
    cxf-2.7.3.jar
    httpasyncclient-4.0-beta3.jar
    httpclient-4.2.1.jar
    httpcore-4.2.2.jar
    httpcore-nio-4.2.2.jar
    neethi-3.0.2.jar
    spring-aop-3.0.7.RELEASE.jar
    spring-asm-3.0.7.RELEASE.jar
    spring-beans-3.0.7.RELEASE.jar
    spring-context-3.0.7.RELEASE.jar
    spring-core-3.0.7.RELEASE.jar
    spring-expression-3.0.7.RELEASE.jar
    spring-web-3.0.7.RELEASE.jar
    wsdl4j-1.6.2.jar
    xmlschema-core-2.0.3.jar

I am creating a sample web service project that pass Student object and return with some changes on that object.
The service is using simple POJO (Plain Old Java Object) bean.

Firstly create a Dynamic Web Project (File->New->Dynamic Web Project) named "CXFTutorial" according to following screenshot.


No comments:

Post a Comment