Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate WADL file using Jersey 1.7

Tags:

java

rest

jersey

I created a hello world REST service and now I d like to generate the WADL file.

I looked around and saw that I can do so by calling :

http://localhost:8090/application.wadl

However I dont get anything in my case. I am using Jersey 1.7 with Eclipse Indigo and running on Apache 7

I also tried calling :

http://localhost:8090/<myapplicattion_name>.wadl but still no result.

Is this feature supported by Jersey 1.7? If yes what do i do wrong?

The web.xml file looks like this:

enter image description here

Thank you

like image 776
panipsilos Avatar asked Oct 17 '13 10:10

panipsilos


People also ask

How do I get WADL from REST services?

The Web Application Description Language (WADL) is an XML-based file format that describes your REST web services application. By default, a basic WADL is generated at runtime and can be accessed from your REST web service by adding a GET to the /application. wadl resource at the base URI of your REST application.

What is a WADL file?

A Web Application Description Language (WADL) document is a machine-readable XML description of HTTP-based web applications (typically REST web services). WADL models the resources provided by a service and the relationships between them.

What is WADL feature?

WADL is the language instructed for explaining the traits or segments of HTTP web solutions/applications. Description of the app's all HTTP resources alongside their correlations and dependencies can be provided using it.


1 Answers

What is the name of your app in Apache, i.e., "context"? Assume the name is "restApp". Try this:

http://localhost:8090/restApp/application.wadl

Or, if you servlet mapping is:

<servlet-mapping>
  <servlet-name>RESTService</servlet-name>
  <url-pattern>/company/rest/*</url-pattern>
</servlet-mapping>

..it would be:

http://localhost:8090/restApp/company/rest/application.wadl
like image 56
ChrisO Avatar answered Oct 11 '22 17:10

ChrisO