My Shitty Code

Embracing the Messiness in Search of Epic Solutions

Tag: JAXB 2

  • JAXB2: Adding toString() to Generated Java Classes

    PROBLEM By default, the generated Java class prints the memory address when toString() is invoked. However, sometimes it is helpful to have a more meaningful toString() for debugging purposes. SOLUTION To fix this, configure maven-jaxb2-plugin to generate toString() based on the fields in the class:-

  • Using Spring Web Services and JAXB to Invoke Web Service Based on WSDL

    There are several ways to consume a web service based on a WSDL from Java. After trying a couple of approaches, I’m currently leaning towards Spring Web Services and JAXB. The biggest advantage of using both Spring Web Services and JAXB to consume a web service is the flexibility to change the web service URL […]