Showing posts from August, 2012

cxf-jaxws-SOAP Example-Live Resturant Example

This is a simple cxf-jaxws application.The appliction offers 2 services
cancel orderplace order The wsdl can be accessed at: http://localhost:8086/cxf-jaxws-LiveResturant/OrderService?wsdl
CXF webservice depends on the service endpoint interface.
Uses spring based configuration.
The application has been tested on tomcat and uses the latest cxf jar files.
Create a web application project in eclipsecxf.xml -add a cxf.xml in web-inf folder <beans xmlns="" xmlns:xsi="" xmlns:jaxws="" xmlns:wsa="" xmlns:wsrm-mgr="" xmlns:wsp="" xmlns:wsrm="" xmlns:wsam="" xmlns:mt…

Code First Webservice using jax-ws and CXF- webservice framework

Create a BeanCreate a SEI-Service End Point InterfaceUse Annotation on the SEI @ webserviceCreate a Implementation Class which implements the SEICreate a CXF.xml file add the  SEI and impl mapping in the xml fileconfigure the cxf file in the web.xmlmap the  spring context listener and cxf servlet in the web.xml.

What are the Front ends Provided by Apache CXF


What is Bindings in Webservice and types of Bindings

Bindings:Maps a webservice message to the protocol.

Types of Bindings:

SOAP bindings:Maps a webservice message to a SOAP service
Pure XML Bindings:sends a raw xml message
HTTP Bindings:Maps webservice message using a RESTFUL service.

Creating threadpool to execute tasks

The below code shows  usage of  util.concourrent.ExecutorService to create a thread pool.
The tasks are executed concurrently using the avilable number of fixed threads.
Below link tells us the difference of thread vs runnable interface

3) Runnable interface represent a Task which can be executed by either plain Thread or Executors or any other means. so logical separation of Task asRunnable than Thread is good design decision.
Read more:

package com.anjana.threadpools; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import com.anjana.dao.TenantManager; public class Main { private static final int NTHREDS = 4; public static void main(String[] args) { ExecutorService executor = Executors.newFixedThreadPool(NTHREDS); TenantManager tm=new Tenan…