Sunday, 11 March 2012

An Analysis of JAX-WS usage of NetBeans 1.1


This is a closer look at JAX-WS examples provided by JAVAEE5/JAVAEE6 tutorials. The names of the examples are helloservice, webclient and appclient.

First, I will provide a dynamic analysis of the file structures and their changes through four phases: init, wsgen/wsimport, build and run.

The dynamic analysis will provide pictures from NetBeans own project window and also external recursive dir listings accompanied by sources. The dir listings will be compared with WinMerge and produced outcomes will be used to compare the files in the different stages of the projects with WinMerge again.

Second, the outcomes of the comparisons will be used as clues for further analysis of build xml files namely the contents of the files, to better understand and pinpoint the jax-ws mechanism used by netbeans.

There will be plenty of pictures and WinMerge outputs to make this a little bit more humane.

1.1 Helloservice

1.1.1 Helloservice(init) initially it does not have a service yet. Helloservice.endpoint will be the location of the webservice.



1.1.2 HelloService’s create the service source phase includes creating the service itself using NetBeans’s New-->WebService command. After this project window looks like this:



The service Hello.java is created. We write into Hello.java:

package helloservice.endpoint;

import javax.jws.WebService;
import javax.jws.WebMethod;

@WebService
public class Hello {
private String message = new String("Hello, ");

public void Hello() {
}

@WebMethod
public String sayHello(String name) {
return message + name + ".";
}
}

The result of recursive dir comparisons with WinMerge showschanges basicly in the
helloserviceARS\src\java\helloservice library which complies with the NetBeans project window picture above but also shows changes in the
helloserviceARS\nbproject
directory which is not displayed in the project window. The WinMerge output follows:



As can be observed above, the size of the build-impl.xml file has increased something like a single line and a new file named jaxws-build.xml is added along with jaxws.xml.
Here jax-ws appears to exist in the initial phase due to a delinquency where I first created the service and then deleted it to collect data but forget that an empty jax-ws.xml remains behind. Do not worry the second stage of this report will handle and explain all the irregularities that may happen at this stage. The second phase will explain based on the contents of files and verify the outcome of the first phase.


1.1.3 When we build the helloservice project, the project window looks like this:



A comparison of the project directories after and before build shows that a directory named build is created and also :



Helloservice/nbproject/genfiles.properties has been altered.

The newly created build directory contains:

Directory of C:\Users\ars\Desktop\helloserviceARS\build

03/10/2012 11:25 PM <DIR> .
03/10/2012 11:25 PM <DIR> ..
03/10/2012 11:25 PM <DIR> empty
03/10/2012 11:25 PM <DIR> generated-sources
03/10/2012 11:25 PM <DIR> web
0 File(s) 0 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\empty
0 File(s) 0 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\generated-sources
03/10/2012 11:25 PM <DIR> ap-source-output
0 File(s) 0 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\generated-sources\ap-source-output
0 File(s) 0 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\web
03/10/2012 11:25 PM 369 index.jsp
03/10/2012 11:25 PM <DIR> META-INF
03/10/2012 11:25 PM <DIR> WEB-INF
1 File(s) 369 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\web\META-INF
03/10/2012 11:25 PM 25 MANIFEST.MF
1 File(s) 25 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\web\WEB-INF
03/10/2012 11:25 PM <DIR> classes
03/10/2012 11:25 PM 524 glassfish-web.xml
03/10/2012 11:25 PM 405 web.xml
2 File(s) 929 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\web\WEB-INF\classes
03/10/2012 11:25 PM <DIR> helloservice
0 File(s) 0 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\web\WEB-INF\classes\helloservice
03/10/2012 11:25 PM <DIR> endpoint
0 File(s) 0 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\build\web\WEB-INF\classes\helloservice\endpoint
03/10/2012 11:25 PM 889 Hello.class
1 File(s) 889 bytes

Directory of C:\Users\ars\Desktop\helloserviceARS\dist
03/10/2012 11:25 PM 3,519 helloserviceARS.war
1 File(s) 3,519 bytes



1.1.4 When we run the project the outcome at the project window is this:



I used the project name helloserviceARS not to delete and remake helloservice. As seen above, helloserviceARS is created as an application on the Glassfish server. The project window does not show any differences but the recursive dir comparison:




Shows a minor change in the helloservice/nbproject/private/private.xml file.