I'm developing a client application of a WebService and I have the corresponding WSDL file inside a jar.
I'm using ant to generate the java code from the wsdl with the following build.xml:
<project name="wsimport" default="wsimport" basedir=".">
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" />
<target name="wsimport">
<echo message="Starting wsimport"/>
<mkdir dir="target/generated-sources/jaxws-wsimport"/>
<wsimport
wsdl="???"
sourcedestdir="target/generated-sources/jaxws-wsimport"
extension="true"
verbose="true"
target="2.0"
xnocompile="true"
catalog="src/jax-ws-catalog.xml"
wsdlLocation="/MyWebService/MyWebServiceV1_0?wsdl">
<binding dir="src/main/resources/bindings/v1_0" includes="*.xml"/>
<xjcarg value="-XhashCode"/>
<xjcarg value="-Xequals"/>
<xjcarg value="-XtoString"/>
</wsimport>
</target>
</project>
How do I load the WSDL file from a jar? The WSDL references an XSD which is also in the same jar.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…