How to generate wadl file for resteasy in jboss

2019-05-10 18:06发布

I want to generate a wadl file for my project which is using resteasy + Jboss 6.4 + Maven. There are many examples given for jersey but not for resteasy does anyone used it for resteasy

1条回答
【Aperson】
2楼-- · 2019-05-10 19:02

Resteasy since 3.0.14.Final do support WADL generation. You need to add resteasy-wadl to your dependency manager (e.g. maven):

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-wadl</artifactId>
    <version>3.0.19.Final</version>
</dependency>

then declare a new servlet endpoint in your web.xml for providing generated wadl file:

<servlet>
    <servlet-name>WADL</servlet-name>
    <servlet-class>org.jboss.resteasy.wadl.ResteasyWadlServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>WADL</servlet-name>
    <url-pattern>/application.wadl</url-pattern>
</servlet-mapping>

Sources code:

https://github.com/resteasy/Resteasy/tree/master/resteasy-wadl

Implementation ticket:

https://issues.jboss.org/browse/RESTEASY-166

Examples from Resteasy:

https://github.com/resteasy/resteasy-examples/tree/master/wadl-example/src/main/java/org/jboss/resteasy/wadl/testing

查看更多
登录 后发表回答