vivek
vivek

Reputation: 4919

Generate Wadl for apache cxf

Is there any way to automatically generate wadl file for cxf?
Iam having a class that takes all requests like @Path("/") and then redirect to its implementation class. I want to generate wadl for it. Is this possible?
I have done this http://{localhost}:8080/api/?_wadl but Iam getting

<resources base="http://{localhost}:8080/api">
    <resource path="/">
        <!--  Dynamic subresource  -->
        <resource path="/"/>
    </resource>
</resources>

Upvotes: 1

Views: 3406

Answers (3)

Patricio P&#233;rez
Patricio P&#233;rez

Reputation: 1

I know this is kind of old, but it was driving me crazy. If you are not returning an object as your subresource, this should do the trick:

JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
factory.setStaticSubresourceResolution(true);

Just make sure to enable static subresource resolution before you set your service beans :)

Upvotes: 0

vicky
vicky

Reputation: 1046

I don't think that is possible. What you did is dynamic, cxf doesn't know where the request will be directed to. Make sure all services have their own paths, so that you could provide wadl for those services.

Upvotes: 2

Sikorski
Sikorski

Reputation: 2691

Try the following url and it should work, cxf has this ability to generate wadl itself. http://{IP}:{PORT}/{PROJECT-CONTEXT}/{CXF SERVLET CONTEXT}/?_wadl

for eg in my case it is http://localhost:8080/demo-web/api/?_wadl

Upvotes: 3

Related Questions