Hi Altafhusen,
Your message has been moderated, else it would not have reached this Mailing
List.
Please subscribe to the user ML for such questions and then use your email
client.
See why here http://ofbiz.apache.org/mailing-lists.html.
You will get a better support, people can answer you on the ML.
The wider the audience the better the answers you might get.
Also it's more work for moderators who have to accept your messages as long as
you have not subscribed.
I'll personally no longer accept them (other moderators still could).
Thanks
This said, hopefully the main author of the REST API will answer you
Jacques
Le 12/10/2021 à 12:11, Altafhusen Makandar a écrit :
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