How to embed REST/JSON/Javascript to access back end server? (1 post)

  1. rvbinder
    Posted 1 year ago #

    I'm developing a site that will use WP to provide customer facing features, including registration and e-commerce. The main purpose of the site is to create a text file from a file (or text stream) which the user submits. The transformation service is akin to translating from one language to another - i.e., highly algorithmic, so it will be programmed in Java, or similar language.

    A REST interface to the Java translation server looks attractive. After a customer logs in (using WP generated pages), they use another page to upload a file or a stream from a text window. The WP page would then use HTTP POST to send this stream to the server. The server generates the result file. The client (customer WP page) retrieves the result file and then displays it to the customer. There will be more options, but this is essentially how it works.

    The server side will use existing features of either Apache or IIS to call a Java program that generates the result file, and then sends that back to the customer's client. All of this must use HTTPS.

    So, I have two main questions.

    1) Are there plugins that would be useful to set up and maintain the client side functions? I've found several JSON plugins, but most appear to designed for different goals (i.e., not general purpose use of a remote server.)

    2) As REST is uni-directional, I'm wondering what would be a reliable way to manage the response sequence. For example: (a) include the result stream in the response to the HTTP POST (the client would have to block and wait for this response), (b) the POST response is generated immediately and only includes a token. The client doesn't block on the POST, but immediately send a HTTP GET with the token. The server responds to GET when the result file is ready, and includes the result stream in the GET response, or ??

    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic