blob: ef09191cc045e43c7cd4e9bc0b93398c5c155849 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "file:./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "file:./../../../../config/common.xml">
<!ENTITY jaxwsTools SYSTEM "file:./../jaxwstools.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
]>
<project name="soap12" default="all" basedir=".">
&commonSetup;
&commonBuild;
&testproperties;
&jaxwsTools;
<target name="all" depends="clean, setup, runtest, undeploy"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<delete dir="localwsdl"/>
</target>
<target name="setup" depends="assemble-web, assemble-appclient, deploy-app, deploy-appclient"/>
<target name="compile" depends="init-common">
<antcall target="compile-common">
<param name="src" value="endpoint"/>
</antcall>
</target>
<target name="assemble-web" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
<antcall target="wsimport">
<param name="wsimport.args"
value="-wsdllocation WEB-INF/wsdl/AddNumbers.wsdl -extension -b custom-server.xml -keep -d ${build.classes.dir} ${env.APS_HOME}/devtests/webservice/annotations/soap12/AddNumbers.wsdl"/>
</antcall>
<antcall target="compile"/>
<copy file="sun-web.xml.template" tofile="sun-web.xml"/>
<replace file="sun-web.xml">
<replacefilter token="%TOKEN%" value="file:${env.APS_HOME}/build/localwsdl"/>
</replace>
<antcall target="pkg-war">
<param name="wsdlfile.location" value="${env.APS_HOME}/devtests/webservice/annotations/soap12"/>
<param name="wsdlfile.name" value="AddNumbers.wsdl"/>
<param name="war.classes" value="${build.classes.dir}"/>
<param name="war.file" value="${assemble.dir}/${appname}-web.war"/>
</antcall>
</target>
<target name="assemble-appclient" depends="init-common">
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${build.classes.dir}/appclient"/>
<antcall target="wsimport">
<param name="wsimport.args"
value="-b custom-client.xml -extension -keep -d ${build.classes.dir}/appclient ${env.APS_HOME}/devtests/webservice/annotations/soap12/AddNumbers.wsdl"/>
</antcall>
<replace file="appclient/Client.java" value="${http.host}" token="HTTP_HOST"/>
<replace file="appclient/Client.java" value="${http.port}" token="HTTP_PORT"/>
<javac srcdir="." destdir="${build.classes.dir}/appclient"
classpath="${env.APS_HOME}/lib/reporter.jar:${env.S1AS_HOME}/lib/j2ee.jar:${env.S1AS_HOME}/lib/webservices-rt.jar:${env.S1AS_HOME}/lib/webservices-tools.jar"
includes="appclient/**"/>
<mkdir dir="${build.classes.dir}/appclient/META-INF/wsdl"/>
<copy file="AddNumbers.wsdl" todir="${build.classes.dir}/appclient/META-INF/wsdl"/>
<unjar src="${env.APS_HOME}/lib/reporter.jar" dest="${build.classes.dir}/appclient"/>
<copy file="${application-client.xml}" tofile="${build.classes.dir}/META-INF/application-client.xml" failonerror="false"/>
<copy file="sun-application-client.xml.template" tofile="sun-application-client.xml"/>
<replace file="${sun-application-client.xml}">
<replacefilter token="%TOKEN%" value="file:${env.APS_HOME}/build/localwsdl"/>
</replace>
<copy file="${sun-application-client.xml}" tofile="${build.classes.dir}/META-INF/sun-application-client.xml" failonerror="false"/>
<jar jarfile="${assemble.dir}/${appname}-client.jar" manifest="./appclient/MANIFEST.MF">
<fileset dir="${build.classes.dir}/appclient">
<include name="**"/>
</fileset>
</jar>
</target>
<target name="deploy-app">
<antcall target="deploy-war-common">
<param name="contextroot" value="${appname}"/>
</antcall>
</target>
<target name="deploy-appclient">
<antcall target="deploy-client-common"/>
<move file="${assemble.dir}/${appname}-clientClient.jar" toFile="${assemble.dir}/${appname}AppClient.jar"/>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-war-common"/>
<antcall target="undeploy-client-common"/>
</target>
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
<param name="appclient.application.args" value="http://${http.host}:${http.port}"/>
</antcall>
<replace file="appclient/Client.java" token="${http.host}" value="HTTP_HOST"/>
<replace file="appclient/Client.java" token="${http.port}" value="HTTP_PORT"/>
</target>
</project>