I think that one of the things tedious to use in the approach that you mention (taskdef
and wsimport
) is adding environment variables, especially when you want to use SSL and Basic authentication in your web service. I another hand, you can use the wsimport
tool without define a new task. Something like that:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="generate-client" default="main" basedir=".">
<property name="java.home"
value="X:\Software\jdk1.7.0_11" />
<property name="wsdl.location"
value="http://localhost/wsdl" />
<target name="main">
<exec executable="${java.home}\bin\wsimport.exe">
<arg line="${wsdl.location} -s src -Xdebug -verbose -Xnocompile" />
</exec>
</target>
</project>
Now that you have an idea, you can customize the output directory, add the target version ...