Top-down web service creation example in Java using Eclipse
If you have a WSDL file and need to create a SOAP web service, the process is relatively simple. The Eclipse IDE can simply look at the WSDL file and generate all of the Java classes, XML files and other support classes required to fulfill the contract defined by the web service definition language (WSDL) file. This is known as a top-down web service creation approach in Java.
Top-down web service creation approach tutorial
The following video takes you through the entire process of the top-down approach to web service creation using Eclipse. Every step in the top-down web service approach is documented, included everything from the creation of the Eclipse project to the testing of the top-down web service on a Wildfly application server.
Top-down approach to web services example
To summarize the associated video, the basic steps in creating a Java web service using a top-down approach in Eclipse is:
- Create a dynamic web project in Eclipse and name it top-down-web-services-example
- Copy the WSDL file of interest into the WebContent\wsdl folder of the top-down-web-service-example project
- Open the web services creation wizard and specify Top down Java bean Web Service as the type. In the Service definition field, provide the relative path to the WSDL file in the top-down-web-services-example project
- Click Finish to close the wizard and inspect the ScoreKeeperSoapBindingImpl file. Edit the methods defined in this class to implement the web service generated using a top-down approach
- Deploy the project that contains the SOAP web service created with the top-down approach to a Tomcat or Wildfly server
- Right-click on the WSDL file in your top-down-web-service-example project and select Web Services –> Test with Web Services Explorer
- Invoke the various methods on your top-down generated web service and test to ensure that the Java component is working
And that’s it. That’s all there is to using the top-down approach to web service creation.
Modern web services development
Looking for a more modern approach to web service development? Here are some of the latest REST tutorials and SOAP web services examples that we’ve published on TheServerSide. We highly recommend them.
- The RESTful APIs tutorial: The ins and outs of effective RESTful web services
- A step-by-step RESTful web services example with Spring Boot
- Modern SOAP web services development in Java with Eclipse
- Take a bottom-up approach to web service creation in Eclipse
- What is JAX-WS? What is REST?
- SOAP vs REST: Which to choose?
Want to learn about Git?
If you’re interested in learning about the most popular version control system on the market today, take a look at the following Git tutorials and examples
- Five commands in Git you need to master
- When you should git revert a commit
- How to git cherry-pick between Git topic branches
- Change the default editor of Git to Notepad++
- Find the location of Git configuration files
- Pull from GitHub using the Jenkins Git plugin
- Make CI part of your DevOps journey