To generate classes from wsdl, use in ant :
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
<wsimport keep="true" sourcedestdir="..." wsdl="..." wsdllocation="..." xnocompile="true" />
Don't use 'package' attribute on wsimport ant task, so all classes are created in their correct packages.
In general, to customize package, i.e. change generated package name a.b.c to name x.y.z add element to wsimport task and define binding.jxb file as follows.
<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="schema-for-a.b.c.xsd" node="/xs:schema">
<jxb:schemaBindings>
<jxb:package name="x.y.z" />
</jxb:schemaBindings>
</jxb:bindings>
</jxb:bindings>
where schema-for-a.b.c.xsd is the schema generated by wsgen task (that creates wsdl with suitable schemes).
More detailed about JAXB customization : http://java.sun.com/webservices/docs/1.6/tutorial/doc/JavaWSTutorial.pdf, section "Customizing JAXB Bindings"
Hope, this will help to somebody...
kostya
2010-06-22 14:50:11