简体   繁体   中英

Java REST Interface

I have a PHP web application environment. I am using Slim Framework as REST interface for my application. My application front-end is written using Backbone.js and jQuery.

There is a utility (.jar file) which when I use command line makes a remote call (I guess this is a Web Service) which returns me the data.

how do I best incorporate this into my webapplication described on top?

My application front end will have a Button that should make an AJAX call to the REST Interface and fetch the data as JSON.

My approach: PHP-REST interface url is: /api/phprestapi.php exists

Add a JAVA-REST interface at url: /api/javarestapi.java (Perhaps) to separate these two

Existing Environment: LAMP Stack on Ubuntu

How do I achieve this? What is the kind of effort involved?

Thanks for your pointers

If I understand you correctly, you need to be able to return the data being output from the jar into php. If that is the case then you should start looking at the different ways to execute a program from php [1]. exec is probably the most well known.

If you want further control, I would recommend learning more about the web service being called by the jar and doing the call to the web service in php. However, this would take a lot more time than the first option above.

[1] http://php.net/manual/en/ref.exec.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM