23 - Creating WSDL 2.0 and WSDL 1.1 with Java EE: Page 2 of 3

In the following screen browse to where you have unzipped “Apache Tomcat 7” and click Finish. For instance: D:\tutorial\WebService\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 following. 

     

Now click Finish.

Now that we have our web service demo project in place, let’s start creating our initial class. Right click on the source folder and create a new class, called WSDemo and click Finish.

    

In the WSDemo class, let’s define a new method that receives a String as parameter and returns a message:

    

package com.demo.goj;

public class WSDemo {
    public String helloWorld (String name)
    {
        return "Greetings " + name + "! You have reached the web service !";
    }
}

Once we access our web service we will see how this message is returned later in this tutorial.

Now, let’s use eclipse built in plugin for creating web services.

Right click on the WebServiceDemo project and select New / Other

    

Like us on Facebook