How to return the Output for Java Action

0
Hello Community! I am wondering one question that how I can make a customized output Object which is the same with the one that is designed in Studio Pro “Domain Model” in Java Action? This is the Java Action where I specified the “Return type” with customized entity “HttpResponse”.   And here is the Model for “HttpResponse”   And the following is the Java code.   So currently I don’t know how to do to return one Object with type of “HttpResponse” from my Java Action… Like the screenshot in point 3 the constructor of that Entity does not be able to let me input the attributes specified in “Domain Model”. Thanks a lot in advance.
asked
2 answers
1

You need to return the same data type as you specified for your method and action. You expect an implementation of the interface IMendixObject, but you are returning null.

What do you want to achieve? If you want to implement REST API calls, Mendix has an easy to use toolbox to implement it. Java Actions are only recommended if Mendix has no workable support to achieve your goal. It’s also important that you know what you’re doing. 

answered
1

To add to Henri’s answer, if the HttpResponse is a Mendix proxy object, you need to return its iMendixObject, not null. For example...

return httpResponse.getMendixObject();

 

answered