In accordance with the J2EE 1.4 specification, you can occasionally deploy without a complete WSDL file. If done, you must complete some of the service definition. As the following examples illustrate.
Changing the location (SOAP address) for the client:
<webServiceRef configName="${this.config.name}" package="${this.package.name}" serviceRefName="service/HiWS" merge="false">
...other props
<service name="HiWS">
<port name="HiWSSEIPort"
location="http://mymachine:8000/it/worked"/>
</service>
... </webServiceRef>
Completing a partial or incomplete WSDL file:If your WSDL file does not define a service name, you need to specify service name, port name, binding, and location. For example:
<webServiceRef configName="${this.config.name}" package="${this.package.name}" serviceRefName="service/HiWS" merge="false">
... other props
<property name=wsdlLocation" value="c:/myspot/mywsdl.wsdl"/>
<service name="HiWS">
<port name="HiWSSEIPort" binding="tns:HiWSSEIBinding" location="http://mymachine:8000/it/worked"/>
</service>
...</webServiceRef>
This example is for a Web application that contains a Web service client with some WSDL completion values:
<?xml version="1.0"?>
<project name="webapp-hiwsclient" default="configure">
<property name="this.config.name" value="webapp-hiwsclient"/>
<import file="ant-config-tasks.xml"/>
<import file="default-config-targets.xml"/>
<property name="this.package.name" value="hiwsclient"/>
<import file="${this.config.name}-user.xml" optional="true"/>
<property name="djc.verbose" value="false"/>
<property name="web.accessControl" value="default"/>
<property name="web.allowedPorts" value="all"/>
<property name="web.rolePrefix" value="hiwsclient"/>
<property name="web.contextPath" value="HiWSClient"/>
<property name="web.virtualHost" value=""/>
<property name="web.logExceptions" value="true"/>
<property name="web.enableProfiling" value="true"/>
<property name="web.enableTracing" value="true"/>
<property name="web.threadMonitor" value="default"/>
<property name="web.javacTarget" value="1.4"/>
<property name="web.deployDir" value="${djc.home}/deploy/webapps/hiwsclient"/>
<property name="web.classDir" value="${web.deployDir}/WEB-INF/classes"/>
<property name="web.compileJspDir" value="${web.deployDir}/WEB-INF/compiled_jsps"/>
<path id="web.classpath.path.id">
<pathelement path="${web.classDir}"/>
<!-- WEB-INF/lib may not be present in the war, ANT will complain if lib is included in the dir= attribute-->
<fileset dir="${djc.home}/deploy/webapps/hiwsclient/WEB-INF" includes="lib/*.jar lib/*.zip" casesensitive="no"/>
<fileset dir="${djc.home}/lib/default/ext" includes="*.jar *.zip" casesensitive="no"/>
<fileset dir="${djc.home}/lib/ext" includes="*.jar *.zip" casesensitive="no"/>
</path>
<pathconvert pathsep="${path.separator}" property="web.classPath" refid="web.classpath.path.id"/>
<property name="jca.connectionFactory" value="default"/>
<property name="sql.dataSource" value="default"/>
<target name="configure-default">
<echo level="info" message="configure: webapp-hiwsclient"/>
<setProperties component="web.components.hiwsclient.HiServlet" merge="false">
<threadMonitor name="${web.threadMonitor}"/>
<transaction type="BeanManaged"/>
</setProperties>
<setProperties component="web.components.hiwsclient.JspServlet" merge="false">
<threadMonitor name="${web.threadMonitor}"/>
<transaction type="BeanManaged"/>
</setProperties>
<setProperties package="web.components.hiwsclient" merge="false">
<property name="contextPath" value="${web.contextPath}"/>
<property name="virtualHost" value="${web.virtualHost}"/>
<accessControl type="${web.accessControl}"/>
<logExceptions enable="${web.logExceptions}"/>
<profilePublicMethods enable="${web.enableProfiling}"/>
<tracePublicMethods enable="${web.enableTracing}"/>
<classLoader name="web.components.hiwsclient"/>
<permitAccess ports="${web.allowedPorts}"/>
<property name="rolePrefix" value="${web.rolePrefix}"/>
<!-- WebServiceRef: java:comp/env/service/HiWS-->
<bind name="java:comp/env/service/HiWS" webService="web.components.hiwsclient.service.HiWS"/>
</setProperties>
<webServiceRef configName="${this.config.name}" package="${this.package.name}" serviceRefName="service/HiWS" merge="false">
<property name="archiveFile" value="HiWSClient.war"/>
<property name="deploymentDescriptorFile" value="M:\target1.4\deploy\webapps\hiwsclient\WEB-INF\web.xml"/>
<property name="deploymentDescriptorType" value="webapp"/>
<property name="wsdlLocation" value="~/deploy/webapps/hiwsclient/WEB-INF/wsdl/HiWS.wsdl"/>
<property name="localWsdlLocation" value="~/deploy/webapps/hiwsclient/WEB-INF/wsdl/HiWS.wsdl"/>
<service name="HiWS">
<port name="HiWSSEIPort" binding="tns:HiWSSEIBinding" location="http://mymachinename:8000/it/worked"/>
</service>
<property name="serviceInterface" value="org.me.hi.HiWS"/>
<property name="jaxrpcMappingFile" value="~/deploy/webapps/hiwsclient/WEB-INF/HiWS-mapping.xml"/>
<property name="serviceName" value="HiWS"/>
</webServiceRef>
<setProperties classLoader="web.components.hiwsclient" merge="false">
<property name="classPath" value="~/deploy/webapps/hiwsclient/WEB-INF/classes;~/deploy/webapps/hiwsclient/WEB-INF/lib/**"/>
<property name="resolveFirstBySystem" value="org.apache.commons.logging.**,javax.xml.parsers.**, org.w3c.dom.**, org.xml.sax.**"/>
<property name="parentFirst" value="false"/>
<property name="parentClassLoader" value="lib.default-ext"/>
</setProperties>
</target>
<target name="recompile-default">
<echo level="info" message="recompile: webapp-hiwsclient"/>
<rewriteWsdlAddress webService="web.components.hiwsclient.service.HiWS"/>
<djc package="web.components.hiwsclient"/>
<javac target="${web.javacTarget}" source="${web.javacTarget}" srcdir="${djc.home}/genfiles/java/src" destdir="${web.classDir}"
classpath="${web.classPath}"
includes="web/components/hiwsclient/**"/>
</target>
<target name="refresh-default">
<echo level="info" message="refresh: webapp-hiwsclient"/>
<refresh module="webapp-hiwsclient"/>
</target>
<target name="deploy-default">
<echo level="info" message="deploy: webapp-hiwsclient"/>
</target>
<target name="undeploy-default">
<echo level="info" message="undeploy: webapp-hiwsclient"/>
<delete file="${djc.home}/Repository/Instance/com/sybase/djc/util/DjcClassLoader/web.components.hiwsclient.properties"/>
<delete file="${djc.home}/Repository/Instance/com/sybase/djc/ws/client/WebService/web.components.hiwsclient.service.HiWS.properties"/>
<unload module="webapp-hiwsclient"/>
</target>
</project>
It is also possible to point at a different WSDL file, perhaps one with corrected addresses or ports. The property for this is:
<property name="wsdlLocation" value="<wsdllocation>"/>
For example:
<property name="wsdlLocation" value="~/deploy/appclients/ggl5497.usv8202/META-INF/wsdl/TestsServicePartial.wsdl"/>
~deploy refers to the servers deploy directory.