Reputation: 429
I have a Java restful web server responding to web requests from web clients. Some requests are processed by C++/Java programs which are easy to integrate into the Restful web service. But for one kind of the requests, I want to process with my Matlab program. How can I integrate my matlab program with the restful web server so that it can respond to web requests.
It would be the best if the Matlab program is a restful web service itself, which means it can be hosted in a different server, so that the Java restful server can post a request to the Matlab server. The advantage of doing so is that, first, I can host the Matlab program in a different server; second, I can easily test the Matlab program through a REST client such as postman.
Solution:
For any of your interested, I finally used python flask restful API to accept web requests and then make calls to Matlab program
Upvotes: 2
Views: 633
Reputation: 6020
SaturnAPI provides a hosting service and REST API for Octave (the open-source Matlab clone). You basically upload your script and make HTTP requests to it from your own app. Below is a diagram of how it works. Your script is hosted at SaturnAPI, and your HTTP request passes SaturnParams
as input to the script. Once executed, the script's output is used as the response data to the originating HTTP request. Sounds like it is exactly what you are asking for!
Disclosure: I worked on SaturnAPI
Upvotes: 3
Reputation: 429
I found a similar question here: Deploying matlab app on the web using python Here is how I did. Basically I set up a Flask web restful web service to accept web requests (submit values to be inputs to the matlab function), and call the Matlab function from python
Upvotes: 0