How to generate full implementation of Resources cxf-wadl2java-plugin

270 Views Asked by At

I had generated java classes from wadl file through cxf-wadl2java-plugin but the generated Resources file have just null implementation. I was referring wadl options here but found no solution for e.g. -impl : Generates starting implementation code. Can also be used with -interface option

But what about the full implementation of REST endpoints with InputParameters and OutputParameters/Response? Possible to share how it can be done?

currently:

@Path("getdetails/")
public class GetdetailsResource {

    @POST
    @Consumes({"application/xml", "application/json" })
    @Produces({"application/xml", "application/json" })
    public Response GETDETAILS() {
        //TODO: implement
        return null;
    }
}

what I wanted:

@Path("getdetails/")
public class GetdetailsResource {

    @POST
    @Consumes({"application/xml", "application/json" })
    @Produces({"application/xml", "application/json" })
    public Response GETDETAILS(InputParameters inputParameters) {
        //TODO: implement
        ....
        ......
        OutputParameters outputparamters;
        ....
        ......
        return outputparamters;
    }
}

tried with :

<wadlOption> <impl>true</impl>
<generateImpl>true</generateImpl>

Currently I am referring : https://cxf.apache.org/docs/jaxrs-services-description.html

And the wadl file looks something like below:

<?xml version = '1.0' encoding = 'UTF-8'?>
<application name="APIS" targetNamespace="http://xmlns.oracle.com/apps/soaprovider/plsql/rest/apis/" xmlns:tns="http://xmlns.oracle.com/apps/apis/"  xmlns:tns="http://xmlns.oracle.com/apps/soaprovider/plsql/rest/apis/" xmlns="http://wadl.dev.java.net/2009/02" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns11="http://xmlns.oracle.com/apps/rest/apis/getdetails/" 
   <grammars>

      <include href="getdetails_TYPEDEF.xsd" />
   
   </grammars>
   <resources base="http://localhost:8080/webservices/rest/apis/">
      
      <resource path="getdetails/">
         <method id="getdetails" name="POST">
            <request>
               <representation mediaType="application/xml" type="getdetails_Input"/>
               <representation mediaType="application/json" type="getdetails_Input"/>
            </request>
            <response>
               <representation mediaType="application/xml" type="getdetails_Output"/>
               <representation mediaType="application/json" type="getdetails_Output"/>
            </response>
         </method>
      </resource>
     
   </resources>
</application>
0

There are 0 best solutions below