For our sample
web service project, we've not created any files in these directories. In the src/java
directory however we've created a package hierarchy soabook.ch6 and included a
Java file in this package called sayHello.java
Within the web/web-inf folder we can see the WSDL file we have
created??”helloWorldWSDL.wsdl
Now we have done all the coding necessary for our sample contract first web
service??”the next stage is to deploy the web service to the application server.
Right-click on the project in the Project pane and select the Undeploy and Deploy
option. NetBeans will now take a few seconds to deploy the web service to the
application server.
To test the web service, we can use the inbuilt NetBeans web service testing
tool. Expand the Web Services node within the project explorer, right-click on
helloWorldWSDLService and choose the Test Web Service Option.
WSDL Editor
[ 138 ]
Invoking the Test Web Service tool causes the system default browser to be
displayed running the web service test tool. This lists all the operations available to
the service and allows them all to be interactively tested. Enter your name into the
edit box and press the sayHello button to invoke the sayHello method.
Chapter 6
[ 139 ]
If everything goes as expected, you should now see a page similar to that shown
below showing the results of the web service operation and the input and output
SOAP messages passed to and received from the web service.
Pages:
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132