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!
You can run wsimport command from any directory where you like to generate stubs. We have published a sample soap web service which we going to use in this example. You can use this sample service URL https://test.java4coding.com/core/service/service.php?wsdl to test the wsimport command.
The wsimport command-line tool processes an existing Web Services Description Language (WSDL) file and generates the required artifacts for developing Java™ API for XML-Based Web Services (JAX-WS) web service applications.
The wsimport tool is used to parse an existing Web Services Description Language (WSDL) file and generate required files (JAX-WS portable artifacts) for web service client to access the published web services. This wsimport tool is available in the $JDK/bin folder.
You can use the JAXB2 Basics Plugin to generate equals()
and hashcode()
methods:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With