Preparing.. Service catalog.. Netbeans..
Using Netbeans to create Webservice from WSDL...
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
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
14) Proceed to create webservices for all URL's :
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: