Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate entities from REST service?

I work with REST service provided by RESTeasy. It's REST, so there is no WSDL, right? Does that mean that I have to write all entities on my own and do unmarshalling on my own?

If it would be rest service, I could just download WSDL and then generate client from it. How do i do it with REST, that is served as xml in Atom feed?

I don't really see any advantage in REST, if it has no way of generating client and doesn't provide any public specification of entities.

Thank you for your help.

like image 374
Filip Avatar asked Dec 31 '25 20:12

Filip


1 Answers

Correct, with REST, there's no WSDL like there's with SOAP. That does not mean there's no unmarshalling directly to objects however. You can still use Jax-RS to bind the JSON/XML to an object, so you'll have the flexibility of mapping directly like you would in SOAP, you just need to build this class rather than letting SOAP build it for you.

Consider the example here

like image 122
david99world Avatar answered Jan 03 '26 09:01

david99world



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!