I am using ant wsimport to generate client stub from the wsdls. Also, I would like to generate client classes that implements Serializable
. I would like to generate a different serialVersionUID
for each class. I tried with the binding file that was shown below. But its generating same serialVersionUID
for all the classes. Is there any way I can give my own serialVersionUID
to each class?
<wsimport xendorsed="true" binding="binding.xml" debug="true" keep="true"
verbose="false" sourcedestdir="${generated}" wsdl="${src}${wsdl.file}"
wsdlLocation="${wsdl.file}">
</wsimport>
binding configuration
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<globalBindings>
<serializable uid="1" />
</globalBindings>
</bindings>
Serializable
you are binding yourself for a contract for life; generating random UUIDs? – Avowaluid
s, the OP wants differentuid
s for different classes (i.e. not always the same/1
). Theoretically it is possible to generate auid
based on the contents of the class. Different contents - differentuid
s. So the question makes sense to me. – Powers<xjc:serializable uid="1"/>
customization can only occur within your<jaxb:globalBindings>
see here. Anyway you can add a work around using binding for each element generated. – Eboni