简体   繁体   中英

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>

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

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.

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM