Pages

Saturday, 20 October 2012

Fuse ESB Development,Setup and Installation Step

Fuse ESD Development,First we need to plugin the Fuse IDE in Eclipse.

Fuse ESB Development Setup:
Fuse ESB setup for development, we need prerequisite.
  • JDK 1.6 or above
  • Eclipse: Eclipse Indigo 3.7.x, which has Maven m2e embedded in it.
  • Maven:  
Also you can download the prerequisite Software from this site.

Fuse IDE: Fuse IDE provides the ability to work with Fuse and Apache ActiveMQ, Camel, CXF, Karaf and ServiceMix.
You can view, create and edit Enterprise Integration Patterns, browse endpoints and routes, drag and drop messages, trace message flows etc.
Fuse IDE Version: 2.1.747

Adding Fuse Source for Installation:
To add the update site:
  1.  Select (Help → Install New Software) to open the Install wizard.
  2.  Enter (http://repo.fusesource.com/ide/) in the Work with field.

  1. Click Add to open the Add Repository dialog.
  2.  Enter a name Fuse ESB.
  3.   Click OK.
  4.  The Add Repository editor closes.



          5. Select Fuse IDE check box and click next button.

  6.  Click Next and Select I accept the terms of the license agreement.
          7.  Click Finish to finish installing the software.
          8.  When prompted, click Restart Now.
          9.  Create Fuse ESB project in eclipse.


Create Fuse ESB Project in Eclipse: After the plugin of Fuse IDE ,we can create fuse esb project of Eclipse wizard
1-Select Fuse ESB project on eclipse wizard


2-Select Type of module and create the project like camel,osgi,jbi bundle sample.

3-Sample project Created on eclipse with camel and maven build.



Sunday, 14 October 2012

Creating Code First Web Service (Bottom-UP Approach)

Creating Code First(Bottom-UP approach) Web Service:
I have been talking about bottom up approach for creating web services in this post with using eclipse.
Bottom up we need to write first java code like beans or enterprise beans where as In contract first ,
We need to define contract like XSD,Schema  and wsdl.

Setup Eclipse for developing web services in java:
We need to different software setup like JDK,Web Server or App Server,WTP,etc.  

Prerequisite Installation:
Install JDK
Install Web Server or App Server like Tomcat, boss.
Install Eclipse like Indigo, Helios, etc.

Setup:
1-When Eclipse is installed then you can check your eclipse preferences (Windows -> Preferences) where Web Service preference is present in the list or not.

 If Web Service preference is not there then you need to plugin WTP (Web Tools Platform) after plugin Web Services link would be available in the eclipse. Link for Helios plugin http://download.eclipse.org/webtools/repository/helios/




2-Configure installed JRE in eclipse (Windows -> Preferences -> Java -> Installed JREs)


3-Setup CXF or Axis2 runtime: In eclipse go to Windows -> Preferences
 And select CXF or Apache Axis2 as per runtime adds runtime to eclipse for creating web services.

I have taken Apache CXF for creating service so I select the CXF preference.






Click on Add button and browse the Apache CXF runtime.



Click Finish button and get the added CXF runtime.then apply and ok




Creating a Web service: Now, we can start to create web service on eclipse using Apache CXF runtime.

Steps:
1-Create a dynamics web project in Eclipse.


  a-      project name ex. StandardWebService
 b-     Select Runtime like apache tomcat v7.0
 c-      Click on modify button for setting facts.

2-Select Apache CXF runtime
Click on modify button, you can select the CXF check box for this project.


Here we can select Apache cxf or apache axis as engine for creating service. Now i am using apache cxf engine for creating service.

3-Write the Java classes which you want create as service:


I have written these classes as sample like

a-      Product

b-      ProductService (it is interface, it has two methods)

c-      ProductServiceImpl (it is implementation of product service)



Saturday, 29 September 2012

Web Services

Web Services:
“Web services are set of standards that enable to interoperable integration between disparate process and systems, running on variety of platforms and frameworks”. 

Simple term of web services def
 Web service is a small unit of program which allows us to create client/server applications. It is yet another distributed computing technology like Corba, RMI, and EJB etc.

 It is used to access distributed resources like
  • Web Services access to shared data
  • Web Services access to shared program
  • Web Services connect system and devices (like CPU, Memory, printer, etc.)
  • Web Services provide communication between different technology applications 

Web Services are
·         Web Services platform independent.
·         Web Services language independent.
·         Web Services implementation independent.
·         Web services make application component reusable.

Web Services Architecture:








Web Service Components:
WSDL (Web Service Description Language):  it is XML based description of web services. it is used to locate and describe the web services.

SOAP (Simple Object Access Protocol): It is a protocol for accessing the web services and it is XML based structure used to send and receive the request and response of services as XML message (SOAP Message).

UDDI (Universal Description, Discovery and Integration): It is XML based registry to publish service and find the service from registry.


Web services benefits:
  • Language neutrality 
  • Interoperability 
  • Industry support 
  • Application component reusable.

                     
How can create Web Service:
We can create web services in Java using different service engine like Apache axis2 and Apache CXF.

Apache Axis2: Axis2 is a Web Services / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack. There are two implementations of the Apache Axis2.
More details you can refer this link http://axis.apache.org/axis2/java/core/

Apache CXF: Apache CXF is an open source services framework. CXF helps you build and develop 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.
More details you can refer this link http://cxf.apache.org/

Building Web Services:
We can implement the web services two ways by using Apache Axis2 or Apache CXF in java.  
1-Code First Services (Bottom-UP Approach).
·         First write a normal java code.
·         Expose Interface as web services.
·         WSDL would available for the client.

2-Contract First or WSDL First Services (Top-Down Approach)

·         First write a schema, xsd and wsdl file.
·         Create interface and other code using service engine from wsdl.
·         Add business logic.
·         Expose interface with business logic as web services.
·         Service would be available for client.


Friday, 7 September 2012

ESB (Enterprise Service Bus)

Enterprise Service Bus:

Nowadays, ESB is buzz word in the software industries and that’s why lots of ESB available in the market as open source as well as Enterprise, I think it is required to solve the integration challenges in various web services, applications, and other technologies into a single network via ESB in SOA Fashion. It’s also useful for architects and managers who are evaluating different app integration and majority of functionality can be leveraged without writing much line of code. As such developers who find themselves repeatedly solving the same integration problems will also be find the useful.

ESB Definition: 
ESB (enterprise service bus) is a software architecture model that provides integration different software applications in SOA manner.

In a Sentence: An Enterprise Service Bus (ESB) is a distributed middleware system for integrating enterprise IT assets using a service-oriented approach.

An Enterprise Service Bus (ESB) is an infrastructure used for enterprise integration using a service-oriented approach. Its main features are:
•       It has a set of service containers, used to adapt a wide variety of IT assets to the ESB.
•       It has a reliable messaging system, used to allow the service containers to interact.
•       It has a standard (WSDL) services model is used for inter-container interaction. That is, all adapted assets are modeled using services. An asset can be a provider of services, a consumer of services, or both. The services model is based on message exchange.
•       It uses messages that are exchanged between containers using standard message exchange patterns.
•       It uses messages that consist of XML data, and message metadata.
•       It provides message transformation services
•       It provides message routing services
•       It provides security features to control access to services
•       It is centrally administered, despite being a distributed system.
•       It allows incremental changes to services without requiring shutdown or other disturbance to system availability.