08 - SOAP Web Service example in Java

For the example in this tutorial we will be using Eclipse Kepler for Java EE and Axis2 for development. For testing our webservice we will be using SoapUI. As a web server we will be using Tomcat 7

Download Eclipse Kepler from: http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplersr2

Download Axis2 1.6.2 from http://axis.apache.org/axis2/java/core/download.cgi and extract it in any folder, for instance: D:\tutorial\SOAP\axis2-1.6.2

Download Tomcat 7 from: http://tomcat.apache.org/download-70.cgi and extract it in any folder, for instance: D:\tutorial\SOAP\apache-tomcat-7.0.52

Now we will configure Axis2, in Eclipse go to: Window/Preference

In the Preferences window, select WebServices / Axis2 preferences and select the runtime for Axis2 and click OK.


Now let’s create a new Dynamic Web Project:


Select a name for the project; in our case we will use the name: SOAPDemo.


Now we will create a new runtime, click on New Runtime

On the New Server Runtime Environment window, select Apache Tomcat 7 and click Next.


In the following screen browse to where you have unzipped “Apache Tomcat 7” and click Finish. For instance: D:\tutorial\SOAP\apache-tomcat-7.0.52

Now, select a Dynamic web module version 2.5 from the dropdown list.

Now, we will make some configuration changes, so click on Modify button.

In the Project Facets select Axis2 Web Services and mark Core and Extensions, click on Save As, and set a name for this Configuration, something like “Axis 2 Configuration” and click OK.  


In the Dynamic Web Project you should have a setup like the fllowing.


Now click Finish.

Like us on Facebook