NetBeans has a bunch of convenient features which make my life as a Java developer that much simpler. Today I’ll be looking at how NetBeans allows you to add web services references into NetBeans.
It’s very simple, open the services tab in NetBeans (Window > Services), there you’ll get a list of different Services such as Servers and Databases. The one we’re interested in is the “Web Services” item, right click it and press “Add Web Service…”. In the dialog box enter the the url of the descriptor file. In this example, I’m using a SOAP web service and therefore using the WSDL link. You can try this with our own web service by signing up here and using the WSDL found here. Press OK and the IDE will add it to the list and fetch the information it needs from the Web Service.
Adding a Web Service to NetBeans allows for you to quickly reference it whenever you need it within a new project. As someone who works on our SaaS platform, I’m usually juggling two web services; our live service and my local instance of the server, sometimes more if I’m hunting down platform specific issues. Being able to quickly swap the two web service references allows me to cut down on some time copying and pasting the WSDL link from the browser each time I want to change it. It’s small but it all adds up.
Another interesting thing you can do with this, is access NetBean’s built-in testing interface. In the services tab you can right click a method associated with the web service and press “Test Method”. This allows you to input parameters and get a result from your web service without needing to write an application.
This post is part of our “NetBeans article Index” series. In these articles, we aim to explore NetBeans in different ways, from useful hint and tips, to our how-to’s, experiences and usage of the NetBeans IDE.