문제

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>
도움이 되었습니까?

해결책 2

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top