The generated classes from my WSDL using wsimport
are not having equals()
and hashcode()
methods. How can I customize and generate the client classes to get equals()
and hashcode()
methods.
I am not sure about using JAXB to achieve this.
In Axis2.0 generated stubs these methods are generated but not sure why such a basic thing is not available in JAXWS!
More information on how it worked. I have to add classpath to
jaxb2-commons
and without which wsimport runs without complaining but nothing happens! After adding the classpath as belowthe below wsimport worked as expected
If you are looking to generate hashcode() and equals() using wsimport in maven, check this answer on how to generate value constructors, but also includes the configuration for generating hashcode() and equals() too:
How do I make wsimport generate constructors?
You can use the JAXB2 Basics Plugin to generate
equals()
andhashcode()
methods: