Wednesday, 14 March 2012

An Analysis of JAX-WS usage of NetBeans2.1

Helloservice Content Comparison of development phases

A study of the differences in the contents of the folder and file structures of the four phases of helloservice shows us:

1. The changes in the nbproject folder that occur just after the creation of the webservice reflect the use of wsgen: Helloservice/nbproject/: The increase in the size of build-impl.xml , project.xml, genfiles.properties and the addition of jaxws-build.xml and jax-ws.xml
Please note the addition of helloservice\src\java\helloservice\endpoint\Hello.java to the src folder at the wsgen phase which can easily be observed at the netbeans IDE.

1.1 The addition to build-impl.xml is at the top:

<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="helloserviceARS-impl">
<import file="jaxws-build.xml"/>

1.2 The addition to project.xml is to the extensions part:
<?xml version="1.0" encoding="UTF-8" ?>
- <project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.project</type>
- <configuration>
- <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
<extension file="jaxws-build.xml" id="jaxws" />
</buildExtensions>

1.3 jax-ws.xml is:
<?xml version="1.0" encoding="UTF-8" ?>
- <jax-ws xmlns="http://www.netbeans.org/ns/jax-ws/1">
- <services>
- <service name="Hello">
<implementation-class>helloservice.endpoint.Hello</implementation-class>
</service>
</services>
<clients />
</jax-ws>

1.4 jaxws-build.xml is:
<?xml version="1.0" encoding="UTF-8" ?>
- <!--
*** GENERATED FROM jax-ws.xml - DO NOT EDIT ! ***
*** TO MODIFY wsimport options USE Web Service node -> Edit WS Attributes ***
*** TO CHANGE TARGETS GENERATED TO jaxws-build.xml COPY THOSE ***
*** TARGETS TO ../build.xml AND MODIFY THAT FILE INSTEAD ***


-->
- <project xmlns:xalan="http://xml.apache.org/xslt" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
- <!--
===================
JAX-WS WSGEN SECTION
===================

-->
- <target name="wsgen-init" depends="init, -do-compile">
<mkdir dir="${build.generated.sources.dir}/jax-ws/resources/" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.classes.dir}/META-INF" />
<property name="j2ee.platform.wsgen.classpath"value="${libs.jaxws21.classpath}" />
- <taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
<classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}" />
</taskdef>
</target>
- <target name="wsgen-Hello" depends="wsgen-init">
- <copy todir="${build.classes.dir}/META-INF">
<fileset dir="${webinf.dir}" includes="wsit-helloservice.endpoint.Hello.xml" />
</copy>
- <wsgen sourcedestdir="${build.generated.sources.dir}/jax-ws" resourcedestdir="${build.generated.sources.dir}/jax-ws/resources/" destdir="${build.generated.sources.dir}/jax-ws" verbose="true" xendorsed="true" keep="true" genwsdl="true" sei="helloservice.endpoint.Hello">
<classpath path="${java.home}/../lib/tools.jar:${build.classes.dir}:${j2ee.platform.wsgen.classpath}:${javac.classpath}" />
</wsgen>
</target>
- <!--
===================
JAX-WS WSIMPORT SECTION
===================

-->
</project>



1.5 The changes in Helloservice/nbproject/genfiles.properties : are related with CRC values:
nbproject/build-impl.xml.data.CRC32=eb7dd51f
nbproject/build-impl.xml.script.CRC32=d96d99ca
nbproject/build-impl.xml.stylesheet.CRC32=8ca9f0e6@1.31.1.1
nbproject/jaxws-build.xml.stylesheet.CRC32=03b77b15

Please note that a new CRC record is created for jaxws-build.xml


2. After we build the helloservice project: the helloservice/dist and helloservice/build folders appear.

The build folder has:
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

\build\empty is empty.
\build\generated-sources\ap-source-output is empty.

\build\web has the compile-build outputs of the index.jsp and the Hello.java
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
Directory of C:\Users\ars\Desktop\helloserviceARS3build\build\web\META-INF
03/10/2012 11:25 PM 25 MANIFEST.MF
Directory of C:\Users\ars\Desktop\helloserviceARS3build\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

\build\web\WEB-INF\classes\helloservice\endpoint\Hello.class

3. After we run the helloservice project and create the webservice on the server:
There is a trivial change in the nbproject/private/private.xml file: The open-files item is added.
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
<file>file:/C:/Users/ars/Desktop/helloserviceARS/web/index.jsp</file>
</open-files>
</project-private>