Dear Team,

I am implementing the REST API and the service does not take the Class
object as the input. Instead, I need to provide the Map as input mode and
the use ObjectMapper in my service class to map it to a specific class
object. Below is an example.

<service name="createEmployee" engine="java"
         location="abc.def.EmployeeService" invoke="createEmployee" auth="true">
    <attribute name="employee" type="Map" mode="IN" optional="false"/>
    <attribute name="employee" type="abc.def.model.Employee"
mode="OUT" optional="true"/>
</service>

The type for attribute with mode="IN" should be abc.def.model.Employee but
I am setting it to Map. This is because the IN mode is not accepting the
model class. Instead I need to use the ObjectMapper to convert it to the
object of the respective class.

Another problem I am facing is that the ServiceUtil class does not provide
a facility to send 404 error code. Instead I always get 422 error code. Is
there any way to return specific error codes?

Thanks & Regards,
Altaf

Reply via email to