Search code examples
jaxbjax-ws

How to generate equals() and hashcode() methods using wsimport in jaxws


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!


Solution

  • You can use the JAXB2 Basics Plugin to generate equals() and hashcode() methods: