Web Services 2.0 and Sun Java System Web Server 7

Sun Java System Web Server 7 Technology Preview released today, has many neat features.
One of them is the support for Web Services 2.0.

Web Server 7 integrates all the latest JWSDP 2.0 runtime components except JAXR and old JAX-RPC. This makes Sun Java System Web Server 7 with its superior scalability, security, robustness and extensive administrative support, well suited for Web Services development and deployment.

No special configuration is needed to run Web Services on Web Server 7. As JWSDP 2.0 is integrated with our Web Server, all JWSDP web applications should run when deployed as a web app.

Here, I will not explain how to write a Web Service or how to use the tools apt, wsgen, wsimport to generate the jaxws artifacts. Instead, let us see how we can deploy and run the samples that are bundled with JWSDP 2.0 pack on Web Server 7.


Running JWSDP 2.0 samples on Web Server 7


Web application samples in the downloaded JWSDP 2.0 need changes to their configuration files to deploy them to the Web Server 7. Specifically, configuration files in the jaxws samples need to be edited to make them deployable on Web Server 7.
The steps are as follows:

1. Download JWSDP 2.0
2. Create a Web Server specific sjsws.props at $JWSDP_HOME/jwsdp-shared/bin
3. Here is a sample sjsws.props file. All fields present here should be defined.

#Administration Server user
ADMIN_USER=admin

#Administartion Server SSL port number
ADMIN_PORT=8989

#Administartion Server host name
ADMIN_HOST=localhost

#Absolute path to the file with Administration Server's User password
ADMIN_PASSWORD_FILE=/tmp/admin.passwd

#Server Config name
CONFIG=jwsdp

#Virtual Server name
VS=jwsdp

#Web Server installation directory
WS_HOME=/test/ws7

#Web Server instance port number
WS_PORT=5555

#Web Server instance host name
WS_HOST=localhost


Note: admin.passwd file has the admin server user password. An example of this entry would be:
wadm_password=adminadmin


4. Modify the build.xml and etc/deploy-targets.xml files of the sample you plan to run. Note that the changes needed in deploy-targets.xml is not sample specific. You should be able to use a master copy and copy it into the etc. directory of the application you plan to run.

4.1. build.xml changes :
Comment out the Application server lib.home definition at the top of the build.xml and add the Web Server lib location. The changed build.xml snippet looks as follows:

<!--

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
\*\* Comment out the Application Server lib.home declaration \*\*
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

<property file="../../../jwsdp-shared/bin/sjsas.props"/>
<condition property="lib.home" value="${DOMAIN_DIR}/../lib">
<available file="../../../jwsdp-shared/bin/sjsas.props"/>

</condition>
<condition property="lib.home" value="${env.JAXWS_HOME}/lib">
<not>

<available file="../../../jwsdp-shared/bin/sjsas.props"/>

</not>

</condition>

-->

<!--
\*\* Add the Web Server library location \*\*
-->
<property name="lib.home" value="${WS_HOME}/lib" />


4.2. deploy-targets.xml changes :
Replace the etc/deploy-targets.xml file with a Web Server specific deploy-targets.xml file. This change will deploy the web application onto the Web Server . The new deploy-targets.xml is below:

<!--
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.

You can obtain a copy of the license at https://jwsdp.dev.java.net/CDDLv1.0.html
See the License for the specific language governing permissions and limitations under the License.

When distributing Covered Code, include this CDDL HEADER in each file and include the License file at https://jwsdp.dev.java.net/CDDLv1.0.html If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-->

<!-- Loading Web Server properties -->
<property environment="env"/>
<property file="../../../jwsdp-shared/bin/sjsws.props"/>
<property name="ws.home" value="${WS_HOME}"/>
<property name="ws.admin" value="${ws.home}/bin/wadm"/>
<property name="lib.sample.home" value="${basedir}/../lib"/>
<property name="build.home" value="${basedir}/build"/>
<property name="build.classes.home" value="${build.home}/classes"/>
<property name="build.war.home" value="${build.home}/war"/>
<property name="config" value="${CONFIG}"/>

<target name="deploy">
<exec executable="${ws.admin}" vmlauncher="true">

<arg value="add-webapp" />
<arg value="--user=${ADMIN_USER}" />
<arg value="--password-file=${ADMIN_PASSWORD_FILE}" />
<arg value="--host=${ADMIN_HOST}" />
<arg value="--port=${ADMIN_PORT}" />
<arg value="--config=${CONFIG}" />
<arg value="--vs=${VS}" />
<arg value="--uri=/jaxws-${ant.project.name}" />
<arg value="${build.war.home}/jaxws-${ant.project.name}.war" />
</exec>

<antcall target="commit-config" />

</target>

<target name="commit-config">
<exec executable="${ws.admin}" vmlauncher="true">
<arg value="deploy-config" />
<arg value="--user=${ADMIN_USER}" />
<arg value="--password-file=${ADMIN_PASSWORD_FILE}" />
<arg value="--host=${ADMIN_HOST}" />
<arg value="--port=${ADMIN_PORT}" />
<arg value="--force=true" />
<arg value="${CONFIG}" />
</exec>
</target>


5. After making the above changes, run the ant tasks to compile the server and client.
Note: You may have to edit the client wsdl location within the custom-client.xml and build.properties files under the "etc" directory of the sample to point to the hostname and port number of your Web Server.

6. Then run the sample by invoking the appropriate ant task within the build.xml file.
e.g.,
> ant run



Compatibility with JWSDP 1.x


Web Server 7 does not support JWSDP 1.x classes/jars out of box. However, if you want to use JWSDP 1.x, an instance of the Web Server can be easily integrated by either adding the classes to server-class-path in server.xml or by placing the jars in the <WebServer-Instance-Dir>/lib directory. Note that the package names for JWSDP 1.x and JWSDP 2.0 are different. Therefore, the two releases can coexist.

Comments:

Are you basically from Alevoor close to udupi?

Posted by Karthik on November 17, 2006 at 01:44 AM IST #

Post a Comment:
Comments are closed for this entry.
About

seemaa

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today