Hey guys, I'm primarily a software developer for embedded systems and desktop applications. My primary language being C# .NET. As you can see, I'm not much of a web developer.
I'm working on a project for my master's degree that involves machine learning that is supposed to be a tool that a particular website can leverage to get a classification about some data.
Basically, I want a simple interface to my tool. The website operates with a LAMP stack. Here's what needs to happen.
Basically, I just need the equivalent of:
classification = myTool.GetClassification(data);
but across a web service, where the data might be a more complex object with a lot of properties
It was suggested that I could do this with a simple REST web service. The libraries I need to interface with are written in Java and they run Linux web servers, therefore I'm using Java to implement the tool because it appears to be the best choice with my background and the environment they use.
I've been looking into setting up an Ubuntu virtual machine, running Tomcat, with a REST web service to handle the requests from the website (as my development environment). The website would send me some JSON describing the data, and I would respond with a JSON object with information about the result.
I understand the basics on how RESTful services work and map to HTTP requests, but I'm not familiar with JAX-RS implementations in Java and how it all works out. I thought, at first, that the website would basically be sending me a GET request with JSON as the body describing the data they wanted analyzed, and I would issue a response with JSON as the body describing the result. However, I've since learned that GET requests with a body are not really HTTP conforming. Instead, there are query strings and URLs for a GET request, but those are limited by maximum lengths which probably not work well in my case because I need to send a longer object to the tool (maybe quite a bit of text and many properties). I think that a REST interface that wanted to conform to HTTP standards would be left with only POST as an option.
So with a Java REST API like Jersey or RESTeasy, how does this all work? Do I just map an object in java to the API using special attributes in the code and it figures this out for me? Would it know to use a get or a post? Is this a reasonable way to move forward with what I'm doing?
I could spend quite some time trying to learn all about Java REST web services. While, I'd love to learn, I'm limited for time and I don't want to be barking up the wrong tree. If someone who was more knowledgeable in this area could give me some advice, I would really appreciate it.
I'm working on a project for my master's degree that involves machine learning that is supposed to be a tool that a particular website can leverage to get a classification about some data.
Basically, I want a simple interface to my tool. The website operates with a LAMP stack. Here's what needs to happen.
- Website gathers information and create a particular object describing some data
- Website sends me the object and asks me for a classification
- I get the object, analyze it, return the classification (good or bad basically)
- The website decides what to do with my result
Basically, I just need the equivalent of:
classification = myTool.GetClassification(data);
but across a web service, where the data might be a more complex object with a lot of properties
It was suggested that I could do this with a simple REST web service. The libraries I need to interface with are written in Java and they run Linux web servers, therefore I'm using Java to implement the tool because it appears to be the best choice with my background and the environment they use.
I've been looking into setting up an Ubuntu virtual machine, running Tomcat, with a REST web service to handle the requests from the website (as my development environment). The website would send me some JSON describing the data, and I would respond with a JSON object with information about the result.
I understand the basics on how RESTful services work and map to HTTP requests, but I'm not familiar with JAX-RS implementations in Java and how it all works out. I thought, at first, that the website would basically be sending me a GET request with JSON as the body describing the data they wanted analyzed, and I would issue a response with JSON as the body describing the result. However, I've since learned that GET requests with a body are not really HTTP conforming. Instead, there are query strings and URLs for a GET request, but those are limited by maximum lengths which probably not work well in my case because I need to send a longer object to the tool (maybe quite a bit of text and many properties). I think that a REST interface that wanted to conform to HTTP standards would be left with only POST as an option.
So with a Java REST API like Jersey or RESTeasy, how does this all work? Do I just map an object in java to the API using special attributes in the code and it figures this out for me? Would it know to use a get or a post? Is this a reasonable way to move forward with what I'm doing?
I could spend quite some time trying to learn all about Java REST web services. While, I'd love to learn, I'm limited for time and I don't want to be barking up the wrong tree. If someone who was more knowledgeable in this area could give me some advice, I would really appreciate it.