Getting Started with Web Services bottom up WSDL development

This tutorial will guide you how to create a new Web Services project with Bottom up approach.

You can read this earlier post If you want to read what us Bottom up and Top down web service development approach.

This tutorial will help you to get started to use

  • Eclipse WTP Tools
  • Apache Axis2 runtime
  • Create a simple webservice
  • Create simple client

The tutorial is updated version of the one present in Eclipse official website . It follows the same steps

This is a long tutorial and hence has been divided into two posts.

The list of softwares required are

  1. Eclipse J2EE ( I used Indigo) ( Download Eclipse )
  2. Apache Axis runtime( I used 1.6.0 binary distribution ) ( Download Apache Axis )
  3. Apache Tomcat ( I used 7.0.19 windows distribution) ( Download Tomcat )

Environment Setup

1. Extract all the Zip files for above 3 , just note the location of all of these three.

2. Axis Configuration :

Start Eclipse Go to Window > Preferences > Web Services > Axis2 Preferences

Browse for Axis2 folder where you extracted Axis download

Message that Axis runtime loaded successfully will be shown.

Apache Axis Eclipse Settings

 

3) Tomcat Configuration

Start Eclipse Go to Window > Preferences > Server > Runtime Environments

click Add

Browse and give path for tomcat zip where you extracted.

This will configure tomcat for eclipse.

Tomcat setup in eclipse

This completes the system environment setup part for developing new Web Service project

Creation of Project

Next we need to create a project with the support of Axis2 features. Open File -> New -> Other... -> Web -> Dynamic Web Project

Give the project name as BottomUpWebService

Select the target runtime as configured earlier

Select Dynamic web module version as 2.5

In the Configuration , select custom and click Modify

When you select Modify , a new Window Project Facets will come

Choose Apache Axis also along with Java / J2EE

Click Ok to save and exit

Eclipse Dynamic Project creation

 

Eclipse Apache Axis new project

In Project setup wizard , just click Next , Next to complete the project creation

Just write simple addition and subtraction program in src folder

package firstWebService;

public class Calculator {

int sum(int a,int b){
return a+b;
}

int subtract (int c,int d){
return c-d;
}
}

Select Calculator.java, open File -> New -> Other... -> Web Services -> Web Service

Click Next

clip_image001[1]


Click on Web Service runtime and select Apache Axis2

· The Web service wizard would be brought up with Web service type set to Bottom up Java bean Web Service with the service implementation automatically filled in. Move the service scale to Start service.

 


Bottom Uo Java Bean Web Service Eclipse


 


On the

If the server is currently stopped , it will say you to Start Server . Just click Start Server

After server has been started , just click finish

Deploy the Project

Right click on the project BottomUpWebService and select Run As > Run on Server

Select the tomcat which you configured earlier to run this project and Click Finish

Apache Axis Startup in Eclipse


The home page will open to show that Apache Axis is running

Click on services

Click on Calculator to see WSDL file of Calculator class generated

WSDL Dispay in Eclipse

 

This completes the WSDL generation

Copy the WSDL URL above , we will need this is next process

http://localhost:8080/BottomUpWebService/services/Calculator?wsdl

Now we will make Client for this project

Create a new Web Service Client project

http://jugnu-life.blogspot.com/2011/08/web-service-client-using-bottom-up.html

Bottom up vs Top down Web services development

Bottom up approach

Bottom-up Web services development involves creating a Web service from a Java bean or enterprise bean.

Although bottom-up Web service development may be faster and easier, especially if you are new to Web services, the top-down approach is the recommended way of creating a Web service.

When creating a Web service using a bottom-up approach, first you create a Java bean or EJB bean and then use the Web services wizard to create the WSDL file and Web service.

Top Down

In Top Down approach , business logic first. A contract on business side is finalized and then WSDL is made based on that based on business requirements.WSDL to Java based tools generate necessary files .Top-down Web services development involves creating a Web service from a WSDL file.

When creating a Web service using a top-down approach, first you design the implementation of the Web service by creating a WSDL file. You can do this using the WSDL Editor. You can then use the Web services wizard to create the Web service and skeleton Java classes to which you can add the required code.

In this way you have more control over how business logic is being handled by creating WSDL first

Although bottom-up Web service development may be faster and easier, especially if you are new to Web services, the top-down approach is the recommended way of creating a Web service. By creating the WSDL file first you will ultimately have more control over the Web service, and can eliminate interoperability issues that may arise when creating a Web service using the bottom-up method.

However from final consumer point of view this can be a pain. For example they will not get the data in the format in which they require , they might have to do lot of manipulations , calculations to ultimately consume the data.

---------------------

I have seen fight when you are not in WSDL side , IT people who are at consumer side want that WSDL should directly provide us this data in format in which they can consume easily.

The bottom up approach generates web services for which the design is driven from an application point of view (developer driven) and will not address the need for other consumers.

Some useful Websites with pros and cons on Top and Bottom up approach

http://www.infoq.com/news/2010/07/top-down-bottom-up-soa

http://oracled.wordpress.com/2009/12/25/developing-web-service-top-down-vs-bottom-up-approach/

http://technologyandleadership.com/top-down-vs-bottom-up-soa/

Save webpage for reading later

Often we find something interesting to read online and don't have time to read it at that moment.
We tend to bookmark those pages and we forget. I found this website ReadItLater.com it has apps for all devices from Android to iPad to pc mozilla FireFox.

Now whenever I come accross any website article which u want to read later I just click readitlater icon on my mozilla browser , or android mobile browser and it gets saved onto cloud server of the ReaditLater website.

Also I have Android app for the same installed which I use to fetch those pages and read whenever i am free.

The good part it also saves where I left reading during last reading session and the best part its all Free

Try it you would love it am sure.

What is US Debt crisis

US Government borrows money like any other government of the world to pay its bills for various expenditures.

US has limits to which the can borrow money and hence be under debt limit. The current limit for amount which can be borrowed is USD 14.3 trillion . The limit has been already reached in May 2011 and calls have been made to raise this limit. Since the limit has been already reached Government stopped payments for two pension schemes.

Now to raise this debt limit law has to be passed by US Congress , Republicans and Democrats have different views on how to deal with this problem.

Although both parties agree that debt has to be reduced some how , but Government want to raise straight away , and Republicans want first to think of decreasing debt and then think of talking on increasing debt limits

A very good summary of What is US debt crisis is present in Guardian website

 

Okay , I am a positive guy with habit to see things positively even if nothing is going right , I am presenting here few graphs which will tend to show some positive side of this all.

Various graphs are presented here to show , US is still largest pumping house of world . The need of the hour is to increase earnings , decrease useless spendings.

The graphs are more or less self explanatory

 

 

IBM 000-032 Cloud Computing exam

At last after long wait , I am giving IBM 000-032 exam next week. All things booked and I hope this time exam don't get cancelled.

I have prepared using the official IBM exam learning objectives. After my exam I will be writing in detail on how to prepare for IBM cloud computing solution advisor certification 000-032.

Wish me luck :)

The Football

As the football enters the ground the players starts kicking it from here and there without thinking if football wants to play with them or not.

The life of a fresher in Indian IT companies is just like football, the moment you enter it , the people from RMG would start kicking you to dump you in some project.

The project managers do their part kicking them, shifting them from one project to another without asking them; what their wish is? Irrespective of fact that people have affinity, liking for some technology the managers would kick you throw you wherever they want.

History repeated itself in front of me today; my manager shifted one of the fresher who recently joined our team. I was astonished by the ability to grasp things among both of these girls, working along with us on our deliveries within just 10 days of their joining.

I came to know while interacting with them about their Passion for web technologies and web development. But this doesn't matter to people up the ladder. For them we are just resource, a way to show our names and bill the customer for 9.5 hours.

I wish i could stop my manager to repeat this all over, I wish I could say not to do what time has done with me, not to do it with Alekhya. Let her stay and work for the things for which she is passionate about.

I wish i had brains to understand the managers, I wish my manager could look deep inside our heart to know what we want. I wish we were not just "The Football"

Scheduling content display in liferay

Liferay out of the box has provision to schedule display and expiry of the content

It means we can just set at what time to show particular content and when to take that off from website.

The time zone which is picked up by default is GMT , however you can set the portal time in portal properties.

In add or edit mode of content there is scheduling option, just select the time at which you want content to be shown.

Select never expire checkbox if you want content to never expire

If the content can expire ( for example some special Christmas offer valid for 2 days ) you specify expiry date and time after unchecking never expire checkbox.

Just take care of time zone settings and its pretty easy.