Sun Java System Web Server 7.0 Administrator's Guide

Appendix C Web Services

For running web services on Sun Java System Web Server 7.0, no extra configuration is needed. JWSDP is integrated with the server and therefore all JWSDP web applications should run when deployed as a web application.

For more information on deploying web applications, see Adding a Web Application.

Running JWSDP 2.0 samples on Web Server 7.0

You need to modify the configuration files of web application samples in JWSDP 2.0 before deploying to Web Server 7.0. Specifically, configuration files in the jaxws samples need to be edited to make them deployable on Web Server 7.0. The steps are as follows:

ProcedureRunning JWSDP 2.0 samples

  1. Download JWSDP 2.0.

  2. Create a Web Server specific sjsws.props at $JWSDP_HOME/jwsdp-shared/bin.

    A sample sjws.props is provided below. All the fields are mandatory.


    ADMIN_USER=admin
    ADMIN_PORT=8800
    ADMIN_HOST=localhost
    ADMIN_PASSWORD_FILE=/tmp/admin.passwd
    CONFIG=jwsdp
    VS=jwsdp
    WS_HOME=/export/ws7.0
    WS_PORT=5555
    WS_HOST=localhost

    Note –

    The admin.passwd file has the administrator' server password. An example of this entry will be: wadm_password=adminadmin


  3. Modify configuration files.

    Modify 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.

    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 is shown below:


    <!--
       **                                                         **
       ** 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" />

    deploy-targets.xml changes.

    Replace the etc/deploy-targets.xml with a web server specific deploy-targets.xml . This change will deploy the web application to the Web Server . The snippet of deploy-targets.xml file is shown below:


    <property environment="env"/>
    <!-- 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>