Reputation: 489
I'm calling a 3rd party restful webservice that returns a complex JSON object. Is there a way for Spring or any open source tool to auto generate the client side code object.
In Soap, I'm use to doing wsdl2java in cxf but I don't know what the equivalent is in the restful space.
In the end I would like to use the rest template to make the following call: restTemplate.getForObject("url", generateObject.class)
Upvotes: 0
Views: 1076
Reputation: 184
For the same thing I used a framework called XStream (http://x-stream.github.io/). It's pretty light and will definately help you :)
Upvotes: 1
Reputation: 509
Answer is yes as long as you have json schema for your input file. I dont remember at the moment how this framework is called but it is google product.
It auto generates Java class annotated with Json. It is really good. I will look for name.
Upvotes: 1