• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I use a schema, when creating a RESTful client?  RSS feed

 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This http://www.mkyong.com/webservices/jax-rs/restful-java-client-with-jersey-client/ looks like a good example of using Jersey/JAX-RS, but I am still not seeing how java classes would be created from the response, using the schema. 
Or am I confused about something here?
I see this schema for petfinder.com http://api.petfinder.com/schemas/0.9/petfinder.xsd and am assuming I would use that some how, to automate generating the java classes from the response xml/json.
Thanks.

 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me back up a little.  I know SOAP web services, and how to use WSDLs.  I am trying to understand if RESTful clients have anything which they can use, to help know what operations/parameters are needed/available.  Does that help add some detail?  Thanks.
 
Tim Moores
Saloon Keeper
Posts: 3831
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XSDs are used with SOAP WS, not REST WS, so I don't think it's useful in creating a REST client.
 
Dave Tolls
Ranch Hand
Posts: 2835
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are annotations that help with this.
Spring has some, but there's also Swagger, which allows for documenting a REST service.
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, RAML and Swagger are the best known models for REST specifications. I've only worked with RAML so far, and in combination with JSON schema it's pretty powerful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!