Java Reference
In-Depth Information
Notice that we can develop web service clients for web services we didn't develop
ourselves. In order to do this, we simply select the
Local File
radio button to use
a WSDL file in our hard drive or the
WSDL
URL
radio button to use a WSDL that
is published online. NetBeans also comes preconfigured to use several publicly
available web services. To develop a client for one of these, click on the
IDE
Registered
radio button.
At this point, a new node labeled
Web Service References
is added to our project.
Expanding this node all the way reveals the operations we defined in our web
services project.
Typically, writing a web services client involves some amount of boilerplate code.
However, when using NetBeans, we can simply drag the web service operation we
wish to invoke to our code. This generates all the necessary boilerplate code and we
just need to specify which parameters we want to send to the web service. Dragging
the
inchesToCentimeters
operation from the
Projects
window to the main class of
our web services client project generates the following code: