I am developing a video search engine for my research in the campus. It is semantic based search engine. I use JavaEE for my backend and I suppose to use php for my front end development. But I want to keep these two as separate web applications and make communication between them. How can I do that, I want to pass data between php to javaEE using web services.
I wrote a code from javaEE to get user inputs and give the output for matching words as json.It is works fin with postman but i want to get those inputs from web page.
@POST
@Path("/setItem")
@Consumes(MediaType.TEXT_PLAIN)
//@Produces(MediaType.APPLICATION_JSON)
public Response getResultForTypedQuery(String item){
initializeOntologyModel();
System.out.println(item);
JSONObject getResultJSON = new JSONObject();
OntologyRelationship OR = new OntologyRelationship();
getResultJSON = OR.OntologyAsJSON(item,model,URI);
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
String JSONobjectConverted = null;
try {
JSONobjectConverted = ow.writeValueAsString(getResultJSON).toString();
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return Response.status(200).entity(JSONobjectConverted).build();
}