Java Action return System.HttpResponse

0
Hi,  I am new in Mendix, now I have a microflow and I wish to create a java action, take a string as parameter and return me a System.HttpResponse. The microflow itself will be act as a http rest endpoint. But however in my generated Java Action, the code show I need to return IMendixObject, I have no clue how I can import and use System.HttpResponse。 Code show as below: @Override     public IMendixObject executeAction() throws Exception     {         // BEGIN USER CODE         //throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");         // END USER CODE     }
asked
1 answers
0

Can you not use the existing built in Mendix REST functionality? You can assign a microflow to an endpoint and that gives you the ability to change the HTTPResponse as a Mendix entity.

https://docs.mendix.com/howto/integration/publish-rest-service

If you want to write a REST service entirely in Java you will need to look at writing a RequestHandler. These have their place, but I would really recommend looking at using the built in functionality where possible to keep your app maintainable.

https://www.mendix.com/blog/requesthandlers-at-your-service/

answered