The Server

You can develop your web service using a groovy script and/or a groovy class. Imagine, we want to publish a web service performing simple arithmetics. First, we have to write the business class implementing the basic operations. In our example, we chose to just implement simple add and square operations. Note that this class is quite generic and could be use locally.

Then we have to publish this service. In order to do so, we use WSServer and create one so called node linking our class with a URL.

Looks like you are not using groovy. You can run the sample pretty much as-is. I just moved the import up to the top and put the whole script in as below. The interesting bit was getting Jetty to stop, as the script terminates but jetty keeps on going.

You can test the service simply by putting this in your browser: "http://localhost:6980/MathService?WSDL"