I am new in REST world, an in most of CXF examples that I saw there is an configuration to expose WADL in REST services when published.
Something like
Available RESTful services:
Endpoint address: http://localhost:8080/ouat-servicesImpl/api
WADL : http://localhost:8080/ouat-servicesImpl/api?_wadl
Then, when clicked
<application>
<grammars/>
<resources base="http://localhost:8080/ouat-servicesImpl/api">
<resource path="/topics">
<method name="POST">
<request>
<representation mediaType="application/json"/>
</request>
<response>
<representation mediaType="application/json"/>
</response>
</method>
</resource>
</resources>
</application>
I was learning RAML and its benefits in contract creation. Is there any way to expose RAML contract in this CXF "home" service page? Or am I mixing the concepts/ purpose of RAML and WADL? Actually I think both are ways to expose services contract, however in my opinion RAML is more complete
Assuming you package your CXF service as a WAR, here is how you can achieve your goal, based on a real project I'm working on:
baseUri
so it can be injected at runtime: https://github.com/openanalytics/RPooli/blob/master/webapp/src/main/webapp/raml/api_v1.raml#L21.raml
as if it's a JSP so injection can work: https://github.com/openanalytics/RPooli/blob/master/webapp/src/main/webapp/WEB-INF/web.xml#L70baseUri
: https://github.com/openanalytics/RPooli/blob/master/webapp/src/main/java/eu/openanalytics/rpooli/web/BaseUriInjectionFilter.javaBonus point for: