Is it possible to get WSDL 2.0 from the annotated JAX-RS class?

Is it possible to get WSDL 2.0 from the annotated JAX-RS class? Do you know any libraries that do this?

ps. Maybe I can use Apache Axis2, Apache Woden or WSDL4J?

SFC. Is it possible to get WSDL from POJO (without any annotations)?

+4
source share
3 answers

As a result, I will use a combination of the following:

  • Apache Woden 1.0-SNAPSHOT to create WSDL 2.0
  • JAXB to discover data properties
  • Java reflection for discovering methods and their parameters
+3
source

Are you developing the JAX-RS annotated class yourself? If not to read further, but if so: why not implement JAX-RS and JAX-WS? This is relatively easy using, for example, CXF.

I have a sample project here: https://trac.nbic.nl/brsp201017/browser/tags/inchi2image-java/inchi2image but more (and better!) Samples and tutorials are downloaded there if you want to implement them together.

What I did was write an interface that I annotated using JAX-WS javax.jws.WebService and javax.jws.WebParam , and implement this interface in a class annotated with JAX-RS javax.ws.rs.Path , javax.ws.rs.GET etc. The only difficult task is to get the right applicationContext.xml and web.xml to use, but this is easy if you have an example.

I am not saying what I did, this is a good example, but it works in my case. If for some reason this does not correspond to your question, let me know and I will try to update my answer.

+2
source

Why do you need WSDL for the JAX-RS class? JAX-RS is not a web services library - it is a library for creating RESTful services that work over HTTP.

If you want WSDL to use CXF or Axis or Java EE web service annotations.

If you want to call the annotated JAX-RS class, explore the client libraries available from RestEasy or Jersey

0
source

All Articles