Skip to main content

CXF – Webservice Example – Contract first

We will use the same WSDL document that we used in our earlier example. The contract is given below:


Step: 1
Run the wsdl2java tool to generate the requires service class, JAXB input output message classes.

wsdl2java.bat -d src -ant -impl -server rateService.wsdl

This command will generate:

JAXB Input and Output message classes, Service Interface, Service Implementation class, Standalone Server class and an ant build file to build the service. If you open up these files in the editor, then you see various JAXB annotations on classes and methods which are used to map a Java class to XML. It will also generate Request and Response Wrapper classes as with the JAX-WS specification. It also generate Request and Response Wrapper classes as with the JAX-WS specification

Step: 2 Implement the Service Interface. A skeleton of the class is already generated with all the required Webservice annotations. A standalone server class is also generated to test the service. The ant file generated will have a target for running the server and the client.
 

To publish the service execute the ant task  InterestRateServiceServer

Comments

Popular posts from this blog

SAAS Simple Maturity Model

There are two architectural models – commonly referred as SAAS Maturity models- that describe the transition of a service to what is called Multi-tenant efficient, highly scalable application. The SAAS Maturity model described by Microsoft has four distinct stages and is illustrated below. Another similar well-known model for SaaS-maturity is known as Forrester-model but adds another stage known as "Dynamic Business Apps-as-a-service". The three key Attributes of a SAAS Architecture: Configurability: Metadata used to configure the way the application behaves for customers Multi-tenant Efficiency : Maximizing the sharing of resources across tenants Scalability: Maximizing concurrency, resource efficiency SAAS Simple Maturity Model (Microsoft, 2006) SaaS Maturity Model (Forres...

CXF Example –Web Service Using Spring and Maven

Apache CXF is an open source services framework. CXF helps you build Web Services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI. Support for bottom up approach and top down approach. Support for Standards JAX-WS, JSR-181, SAAJ, JAX-RS SOAP 1.1, 1.2, WS-I BasicProfile, WS-Security, WS-Addressing, WS-RM, WS-Policy WSDL 1.1 MTOM Building Web Services – Example 1 Develop a simple Web Service using CXF framework. The example in this case is an InterestRate Service. Tools / technologies Version CXF 2.1 Maven 2.0 Tomcat apache-tomcat-6.0.24 JDK java version 1.6.0_20       The Application Scope The "Interest Rate Service" application demonstrates how easily you can develop a Web Service using CXF frame work. The WSDL service definition defines three operations. Below is the InterestRateService interface.   @WebS...

Creating Video Subtitles using Subtitle Workshop and Avidemux

My Tool box: 1. java youtube video downloader – Optional YTD2 is a free Java application for downloading youtube videos as flv/mp4 files.Using hc.apache.org components. (based on the idea of "ytd") http://sourceforge.net/projects/ytd2/ 2. FLV to WMV Converter: A utility to convert .FLV files to .WMV file format. http://www.tubetillatools.com/flv-to-wmv . 3. FLV to AVI Converter: A utility to convert .FLV file to AVI format http://www.tubetillatools.com/flv-to-avi 4. Subtitle Workshop: It is a freeware subtitle editing tool which allows the users to create/edit/convert subtitle files. http://www.urusoft.net 5. Avidemux : is a free open-source program designed for multi-purpose video editing. http://avidemux.org Steps 1, 2, 3, 4, 5 and 6 Step 1: Open your video in Avidemux Step 2: Select the video type ...