<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2923683479019718888</id><updated>2011-11-22T13:17:44.223-08:00</updated><title type='text'>Developing and debugging web services using axis, eclipse and Tomcat</title><subtitle type='html'>You might like to visit
&lt;a href="http://www.mallutalk.com"&gt;www.mallutalk.com&lt;/a&gt;
 and 
&lt;a href="http://www.bobsindia.com"&gt;www.bobsindia.com&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eclipse-axis.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2923683479019718888/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://eclipse-axis.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Boby Thomas</name><uri>http://www.blogger.com/profile/07083502187626733637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_8fIQ58OLy7U/SC2w8f3bYkI/AAAAAAAAAU0/nQOwBNS5GRw/S220/IMG_0431.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2923683479019718888.post-5109136781297458927</id><published>2009-01-24T06:18:00.000-08:00</published><updated>2009-01-24T21:19:47.346-08:00</updated><title type='text'>Developing and debugging web services using axis, eclipse and Tomcat</title><content type='html'>&lt;a href="http://www.mallutalk.com"&gt;&lt;img src="http://www.mallutalk.com/bgallery/images/mallutalk.gif" alt="www.mallutalk.com" width="240" height="60" border="0"/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;Recently I was reading through SOA and I wanted to develop few services using Axis. Since I was already comfortable with eclipse as j2ee development IDE (I use eclipse 3.4 – Ganymede for development purposes). When I started with axis, I wanted to use eclipse for development of web-services too. I struggled couple of hours googling to find best way to write, debug, deploy and distribute web services. &lt;br /&gt;&lt;br /&gt;Initially I used “Axis2 Codegen Wizard” and “Axis2 Service Archiver”. Initially I got few error dialogs like “java.lang.reflect.InvocationTargetException”&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsj4PSz_bI/AAAAAAAAAg8/t41lskVKSCo/s1600-h/error_InvocationTargetException.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 260px; height: 90px;" src="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsj4PSz_bI/AAAAAAAAAg8/t41lskVKSCo/s320/error_InvocationTargetException.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294865235989233074" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;Though I found out way to fix it by adding few jars to the lib folder of the pluggin and modifying the pluggin.xml, it was not really useful as it just generate the required files and there was no possibility I could find to debus the services. Overall, I thought there could be a better way and I googled and finally I would an acceptable way to do development and debug. These are information I put together from my own experience and various sources from internet. &lt;br /&gt;&lt;br /&gt;Before starting, I want to mention my development environment.&lt;br /&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;&lt;b&gt;Development environment&lt;/b&gt;&lt;br /&gt;Java – J2ee SDK 1.4.&lt;br /&gt;Jre 1.5.&lt;br /&gt;Eclipse 3.4 Ganymede.&lt;br /&gt;Axis2 - 1.4&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Create Web Service&lt;/span&gt;&lt;br /&gt;For better clarity, I will take you through one service creation and one client creation using eclipse. For simplicity I will create a simple calculator service with 4 simple service functions. &lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;· add&lt;br /&gt;· divide&lt;br /&gt;· substract&lt;br /&gt;· multiply&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 1: Create a dynamic web project.&lt;/span&gt;&lt;br /&gt;File -&gt; New -&gt; Project -&gt; &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsmn313yWI/AAAAAAAAAhE/m8HpHdSSu3k/s1600-h/dynamic+web+project+1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsmn313yWI/AAAAAAAAAhE/m8HpHdSSu3k/s400/dynamic+web+project+1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294868253350807906" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXsm2Gmp9fI/AAAAAAAAAhM/fcVrS2puUbA/s1600-h/dynamic+web+project+2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXsm2Gmp9fI/AAAAAAAAAhM/fcVrS2puUbA/s400/dynamic+web+project+2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294868497831687666" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsm2rpQ42I/AAAAAAAAAhU/t4CkZKq5kHM/s1600-h/dynamic+web+project+3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsm2rpQ42I/AAAAAAAAAhU/t4CkZKq5kHM/s400/dynamic+web+project+3.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294868507774739298" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Press Finish and you have a new dynamic web project.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 2: Create a simple Calculator class.&lt;/span&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;package org.bpt.Services;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * &lt;br /&gt; * @author Boby Thomas&lt;br /&gt; * &lt;br /&gt; * Axis Service Sample.&lt;br /&gt; * Visit www.bobsindia.com&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;public class Calculator {&lt;br /&gt; &lt;br /&gt; public double add(double arg1, double arg2){&lt;br /&gt;  return arg1 + arg2;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public double substract(double arg1, double arg2){&lt;br /&gt;  return arg1 - arg2;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public double multiply(double arg1, double arg2){&lt;br /&gt;  return arg1 * arg2;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public double divide(double arg1, double arg2){&lt;br /&gt;  if(arg2 != 0) &lt;br /&gt;   return arg1 / arg2;&lt;br /&gt;  else return -1;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 3: Create an axis service from this class.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Right click  Calculator.java &lt;br /&gt;New -&gt; Other -&gt; Web Service&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXspoTD4QjI/AAAAAAAAAhc/043Etu7iWrs/s1600-h/axis+service+1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXspoTD4QjI/AAAAAAAAAhc/043Etu7iWrs/s400/axis+service+1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294871559192199730" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXspor07jDI/AAAAAAAAAhk/A9XTFzqCRQ8/s1600-h/axis+service+2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 342px; height: 400px;" src="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXspor07jDI/AAAAAAAAAhk/A9XTFzqCRQ8/s400/axis+service+2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294871565840387122" /&gt;&lt;/a&gt;&lt;br /&gt;Click on the link and select Axis 2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsporOwYBI/AAAAAAAAAhs/-fFvK5uq2t8/s1600-h/axis+service+3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsporOwYBI/AAAAAAAAAhs/-fFvK5uq2t8/s400/axis+service+3.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294871565680271378" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click OK and click Next in Web service Dialog.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsposViBXI/AAAAAAAAAh0/96A6ONbe5ZQ/s1600-h/axis+service+4.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 305px; height: 400px;" src="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsposViBXI/AAAAAAAAAh0/96A6ONbe5ZQ/s400/axis+service+4.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294871565977126258" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXspo4sX8WI/AAAAAAAAAh8/dTKT0gkdCr8/s1600-h/axis+service+5.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXspo4sX8WI/AAAAAAAAAh8/dTKT0gkdCr8/s400/axis+service+5.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294871569294160226" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now click on Start Server and wait for few seconds. &lt;br /&gt;Press Next&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsp191chbI/AAAAAAAAAiE/7ztnOY1S3oI/s1600-h/axis+service+6.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 309px; height: 400px;" src="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsp191chbI/AAAAAAAAAiE/7ztnOY1S3oI/s400/axis+service+6.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294871794012685746" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Finish. You have created a new axis service, deployed it and started the server now.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Check Services&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;To check the deployed service, check the following URL in a browser.&lt;br /&gt;http://localhost:8080/CalculatorService/services/listServices&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;You see the following screen with the newly created service listed. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsqwfqPFyI/AAAAAAAAAiM/zWfb2VG8yE0/s1600-h/check+service.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 288px;" src="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsqwfqPFyI/AAAAAAAAAiM/zWfb2VG8yE0/s400/check+service.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294872799524886306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To check whether service is working properly, check the following URLs&lt;br /&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;To see the service definition, click the following link.&lt;br /&gt;http://localhost:8080/CalculatorService/services/Calculator?wsdl&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Add Service:&lt;/span&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;http://localhost:8080/CalculatorService/services/Calculator/add?arg1=12&amp;arg2=13&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You see an xml file containing result as below. You can change the arguments to see the service working.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsr1J9fVjI/AAAAAAAAAiU/yjfGFTr9UHs/s1600-h/check+service+2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 260px; height: 90px;" src="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsr1J9fVjI/AAAAAAAAAiU/yjfGFTr9UHs/s400/check+service+2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294873979111036466" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Substract Service&lt;/span&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;http://localhost:8080/CalculatorService/services/Calculator/substract?arg1=12&amp;arg2=13&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;You see an xml file containing result as below. You can change the arguments to see the service working.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsr1fhPrVI/AAAAAAAAAic/ROWVFHqswWk/s1600-h/check+service+3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 226px; height: 85px;" src="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsr1fhPrVI/AAAAAAAAAic/ROWVFHqswWk/s400/check+service+3.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294873984898149714" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Multiply Service&lt;/span&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;http://localhost:8080/CalculatorService/services/Calculator/multiply?arg1=12&amp;arg2=13&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;You see an xml file containing result as below. You can change the arguments to see the service working.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsr1Qd7tFI/AAAAAAAAAik/ZNaq6kDR0Cc/s1600-h/check+service+4.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 242px; height: 94px;" src="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsr1Qd7tFI/AAAAAAAAAik/ZNaq6kDR0Cc/s400/check+service+4.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294873980857726034" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Divide Service&lt;/span&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;http://localhost:8080/CalculatorService/services/Calculator/divide?arg1=12&amp;arg2=13&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;You see an xml file containing result as below. You can change the arguments to see the service working.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsr1RtV9VI/AAAAAAAAAis/KK8J8EzSF14/s1600-h/check+service+5.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 337px; height: 89px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsr1RtV9VI/AAAAAAAAAis/KK8J8EzSF14/s400/check+service+5.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294873981190796626" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cool and easy ..isn’t it?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Creating a Java Client for the web Service&lt;/span&gt;&lt;br /&gt;Now we will create a Java client which used the services we created now. There are many ways to create clients and I will explain one of them. &lt;br /&gt;&lt;br /&gt;File -&gt; New -&gt; Project -&gt; Dynamic Web project&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsui_Y475I/AAAAAAAAAi0/ws_fVMdzXQY/s1600-h/java+client+1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsui_Y475I/AAAAAAAAAi0/ws_fVMdzXQY/s400/java+client+1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294876965570408338" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsujY-7ykI/AAAAAAAAAi8/1-QSDRFoVeU/s1600-h/java+client+2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 346px; height: 400px;" src="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsujY-7ykI/AAAAAAAAAi8/1-QSDRFoVeU/s400/java+client+2.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294876972440865346" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsujV8nacI/AAAAAAAAAjE/tiJ7LGIrrwE/s1600-h/java+client+3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 346px; height: 400px;" src="http://2.bp.blogspot.com/_8fIQ58OLy7U/SXsujV8nacI/AAAAAAAAAjE/tiJ7LGIrrwE/s400/java+client+3.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294876971625834946" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click Finish and now you have a dynamic web project “CalculatorServiceClient”. &lt;br /&gt;Now select on your Calculator.java file in CalculatorService project.&lt;br /&gt;&lt;br /&gt;File -&gt; New -&gt; Other -&gt; Web Service Client&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsujdWa9aI/AAAAAAAAAjM/Mkv-ZkH__20/s1600-h/java+client+4.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsujdWa9aI/AAAAAAAAAjM/Mkv-ZkH__20/s400/java+client+4.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294876973613118882" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXsujXUQCxI/AAAAAAAAAjU/LWgcD78z6_I/s1600-h/java+client+5.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 392px;" src="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXsujXUQCxI/AAAAAAAAAjU/LWgcD78z6_I/s400/java+client+5.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294876971993402130" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Set it to Axis 2.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXsu0wKy9fI/AAAAAAAAAjc/EobKZJwQMDw/s1600-h/java+client+6.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://3.bp.blogspot.com/_8fIQ58OLy7U/SXsu0wKy9fI/AAAAAAAAAjc/EobKZJwQMDw/s400/java+client+6.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294877270722409970" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;Add service definition URL - http://localhost:8080/CalculatorService/services/Calculator?wsdl&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsu06yQB4I/AAAAAAAAAjk/qnjatVjYRWE/s1600-h/java+client+7.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsu06yQB4I/AAAAAAAAAjk/qnjatVjYRWE/s400/java+client+7.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294877273572247426" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select Calculator client project&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsu1QgNV7I/AAAAAAAAAjs/IlhiMq73P6s/s1600-h/java+client+8.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 368px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsu1QgNV7I/AAAAAAAAAjs/IlhiMq73P6s/s400/java+client+8.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294877279402153906" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsu1eox7gI/AAAAAAAAAj0/MXtZ3S1grmA/s1600-h/java+client+9.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 386px; height: 400px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsu1eox7gI/AAAAAAAAAj0/MXtZ3S1grmA/s400/java+client+9.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294877283196202498" /&gt;&lt;/a&gt;&lt;br /&gt;Keep the default setting s and press finish. You see that new classes are created for the client.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsu14ynbUI/AAAAAAAAAj8/7hHEPxDDCLw/s1600-h/java+client+10.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 393px; height: 400px;" src="http://4.bp.blogspot.com/_8fIQ58OLy7U/SXsu14ynbUI/AAAAAAAAAj8/7hHEPxDDCLw/s400/java+client+10.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5294877290216779074" /&gt;&lt;/a&gt;&lt;br /&gt;Now we will write a simple console application which uses these generated classes to access the services – CalculatorServiceClient.java.&lt;br /&gt;&lt;br /&gt;&lt;p style="border:1px #f00 solid; padding: 5px; background-color:#fdd"&gt;&lt;br /&gt;package org.bpt.services;&lt;br /&gt;&lt;br /&gt;import org.apache.axis2.AxisFault;&lt;br /&gt;&lt;br /&gt;public class CalculatorServiceClient {&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  try {&lt;br /&gt;   CalculatorStub stub = new CalculatorStub();&lt;br /&gt;   double val = add(stub, 12,13);&lt;br /&gt;   System.out.println("Got response from add service. result = " +val);&lt;br /&gt;  } catch (AxisFault e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /* fire and forget */&lt;br /&gt; public static double add(CalculatorStub stub, double arg1, double arg2) {&lt;br /&gt;  try {&lt;br /&gt;   CalculatorStub.Add req = new CalculatorStub.Add();&lt;br /&gt;   req.setArg1(arg1);&lt;br /&gt;   req.setArg2(arg2);&lt;br /&gt;   CalculatorStub.AddResponse res = stub.add(req);&lt;br /&gt;   &lt;br /&gt;   return res.get_return();&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;   System.err.println("\n\n\n");&lt;br /&gt;  }&lt;br /&gt;  return -1;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;Run the application and you see the result in the console. Congratulations. You have created your first web service in eclipse. You are now ready to fly to the heights. All the best for a great fly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;About Author&lt;/span&gt;&lt;br /&gt;Visit &lt;a href="http://www.bobsindia.com"&gt;www.bobsindia.com&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mallutalk.com"&gt;&lt;img src="http://www.mallutalk.com/bgallery/images/mallutalk.gif" alt="www.mallutalk.com" width="240" height="60" border="0"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2923683479019718888-5109136781297458927?l=eclipse-axis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eclipse-axis.blogspot.com/feeds/5109136781297458927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://eclipse-axis.blogspot.com/2009/01/developing-and-debugging-web-services.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2923683479019718888/posts/default/5109136781297458927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2923683479019718888/posts/default/5109136781297458927'/><link rel='alternate' type='text/html' href='http://eclipse-axis.blogspot.com/2009/01/developing-and-debugging-web-services.html' title='Developing and debugging web services using axis, eclipse and Tomcat'/><author><name>Boby Thomas</name><uri>http://www.blogger.com/profile/07083502187626733637</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp3.blogger.com/_8fIQ58OLy7U/SC2w8f3bYkI/AAAAAAAAAU0/nQOwBNS5GRw/S220/IMG_0431.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8fIQ58OLy7U/SXsj4PSz_bI/AAAAAAAAAg8/t41lskVKSCo/s72-c/error_InvocationTargetException.JPG' height='72' width='72'/><thr:total>7</thr:total></entry></feed>
