Relevant links










 

Create webservice from WSDL
(deployed java source stubs)
by NetBeans 6.5 "in 60 seconds"

Need for reply webservice

Note that setup of SSL is not considered a relevant issue for this text.

Web service communicates with e-tinglysning either synchronously or asynchronously. In the first case, the requesting webservice receives immediate response - in the latter case, a response is sent to a webservice endpoint, which is either hosted by a service agent or by the requesting part.

Setting up a responding service endpoint is really easy and can basicly be done through a few easy steps in more or less 60 seconds as demonstrated in the following.



Preparing.. Service catalog.. Netbeans..

First obtain the latest tinglysning service catalog: tinglysning-services-x.y.z.zip which being updated all the time. The service catalog may be obtained from Domstolsstyrelsen though links to the left. Inside, you will fx. find /isb/svarservice/binding/administration/1/AbonnementSvar.wsdl which contains relevant definistion for the webservice. The WSDL really belongs on path http://rep.oio.dk/tinglysning.dk/svarservice/interface/administration/1/ which may be accomplished by deploying the static document on a webserver (apache, tomcat, jetty, etc.). The most interesting webservice is perhaps AnmeldelseSvar.wsdl but for simplicity, here will only be processed AbonnementSvar.wsdl.

Forthermore get latest version of Netbeans (currently 6.5) which will be required for generating webservice stubs from WSDL.



Using Netbeans to create Webservice from WSDL...
in 60 easy seconds

1) To setup server http://rep.oio.dk you need to: 1) in the windows host file to include redirection "127.0.0.1 rep.oio.dk", 2) install static web content server on localhost, responding on port 80, 3) unpack static contents from the service catalog onto the static contents web server.

Locate appropriate WSDL file in the browser : http://rep.oio.dk/tinglysning.dk/svarservice/binding/administration/1/AbonnementSvar.wsdl.


Port 8080 is reserved for the GlassFish Enterprise Server included with Netbeans.


2) Next step is to start Netbeans and start creating new project:


3) For new project, select "Web application" and continue next:


4) For project name, select an appropriate service url identifier, which may be exposed publicly and submitted to the electronic tinglysning authority :


5) For deployment server, for convenience, select the GlassFish server bundled with Netebeans:


6) Wrap up the project creation by finishing the project (no need to include frameworks at this point):


7) Once basic project now has been created, it's time to create webservice from WSDL. Do this by right-clicking on the project, selecting New->Web Service from WSDL :


8) Following selection of "Web Service from WSDL", chose the name of the java source code stub (here is selected AbonnementSvarImpl.java). Selection of package name is (with respect to the context selected as tinglys, but that's a rather insignificant part). Either the java stub name or package name will be exposed publicly and may subsequently be changed without affecting publicly exposed URL's.

After entering the WSDL path, appropriate Web srevice port is recovered automaticly.


9) Finishing the process will result in loading of the WSDL and all referenced URL links. So be sure that the localhost rep.oio.dk:80 server is up and running. A couple of warnings will not affect overall success :


10) At this point, the webservice stubs have been created, GlassFish server is not running and the webservice has not yet been deployed. To accomplish all of this, deploy the generated webservice stubs :


At this point, the webservice stubs have been created, GlassFish server is not running and the webservice has not yet been deployed. To accomplish all of this, deploy the generated webservice stubs :

11) Subsequently the server should be starting up and successfull deployment will be reported in the server log trace:


12) Confirmation of successfull server start and deployment may be accomplished by locating GlassFish server project url
http://localhost:8080/tinglysvarservice/AbonnementSvar:


13) The WSDL definition of the newly generated webservice is accessible from URL
http://localhost:8080/tinglysvarservice/AbonnementSvar?wsdl by locating GlassFish server project url
http://localhost:8080/tinglysvarservice/AbonnementSvar:


14) Proceed to create webservices for all URL's :
  • http://rep.oio.dk/tinglysning.dk/svarservice/binding/administration/1/AbonnementSvar.wsdl
  • http://rep.oio.dk/tinglysning.dk/svarservice/binding/administration/1/BrugerformularSvar.wsdl
  • http://rep.oio.dk/tinglysning.dk/svarservice/binding/administration/1/UnderskriftsmappeSvar.wsdl
  • http://rep.oio.dk/tinglysning.dk/svarservice/binding/anmeldelse/1/AnmeldelseSvar.wsdl
  • http://rep.oio.dk/tinglysning.dk/svarservice/binding/fejlservice/1/FejlService.wsdl
  • http://rep.oio.dk/tinglysning.dk/svarservice/binding/integration/1/AnmeldelseKopiSvar.wsdl
and the result will be webservice reply stubs for all reply services from the tinglys application.


15) Now it's easy to modify the source code for the reply listeners to properly handle the answers


16) This concludes webservice stub generation. The generated project may be directly packaged to a .war file from the netbeans workspace and subsequently deployed without any fuss on fx. tomcat 6.x by inserting into the webapps directory: