0

I am trying to create a RESTful webservice in java, but , as I am new to this, I am not sure if there is a tool like wsimport (for SOAP based webservices) which can be used to create the Data objects or Entities (resources in REST world).

I searched the net for examples..But all of them seem to be the hello world types with no clear data modeling details.

How do I create the Data objects for a RESTful Webservice from scratch using just a XSD file ? Any pointers will be helpful!

DntFrgtDSemiCln
  • 1,149
  • 2
  • 11
  • 32

1 Answers1

0

RESTful webservices do not have a contract like SOAP so automatic code generation for the services is difficult unless the RESTful webservices are using WADL (not very commonly used). If you are using WADL, you can use CXF to generate java code.

However if you have XSD files you can generate java code classes for them using JAXB (xjc is the command). This will work well for the Data model objects, service classes will probably need to be hand coded.

See the accepted answer in this question: How to generate JAXB classes from XSD?

A couple more links that might help:

JAXB XJC tutorial

If you use Intellij, see this

Community
  • 1
  • 1
vsnyc
  • 1,997
  • 20
  • 30