3

With SOAP WebSevices and WSDL it's very easy to generate a Java WebService client with wsimport.

Is there a similar way to do this for Java REST clients?

Thanks, Simon

2 Answers 2

1

Take a look at Alchemy Rest Client Generator. It can generate a jersey 2.0 java client for your JAX-RS REST services by integrating into your server builds.

The client will mimic the exact service API. However this project does not yet support WADL and does not handle marshalling and demarshalling of your transfer objects.

Disclaimer: I am the author of this project.

Sign up to request clarification or add additional context in comments.

Comments

0

Do you have a WADL descriptor for your REST service?

If so, you can use wadl2java or maybe something built-in in your IDE (IDEA for example has a wizard for that).

2 Comments

Thanks for your answer. No unfortunately I don't have a WADL. Is there a way to generate it from a example JSON?
Don't think so, as JSON is just a data interchange format, and doesn't say anything about service used to get it. You can generate classes based on JSON, and use them for representation of data returned from the service - look at this: jsongen.byingtondesign.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.