Calling Server webservice from a form on a webpage

Thomas_Ott
Thomas_Ott New Altair Community Member
edited November 5 in Community Q&A

Hi Community,

I need to create a webpage that has a form with one entry field. The end user would enter a value in the form and hit a web button on the page. Then from there it would call a Server webservice using the value as URL Parameter, pass it, score, and send the results back to the web page.

 

Has anyone in the Community done something like this? Is there a sample you can share. My thought is that it will require javascript and possible a response back from the Server as XML or JSON. Looking for any help or a point in the right direction.

 

Thanks!

Answers

  • SGolbert
    SGolbert New Altair Community Member

    Hi Thomas,

     

    I think you are refering to ajax:

     

    https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Fetching_data

     

    I haven't done it yet, but in principle the only problem would be the authentification of the web service. We somehow discussed that in my last server post.

     

    I hope it helps!

  • Thomas_Ott
    Thomas_Ott New Altair Community Member

    @SGolbert Thanks for this link, I'm going to study this. 

     

    W.R.T. to your authentication problem, was that not solved by setting it as an 'anonymous' user? I remember reading that somewhere.

  • Telcontar120
    Telcontar120 New Altair Community Member

    Interesting problem.  You could of course do this as a simple web app on RapidMiner Server itself (entry field with a button to trigger a process to return a scored record or other data).  Based on your requirements, is that not an acceptable solution?  That component could even be framed by an external web page, I believe (as long as the service and the web app were configured for anonymous access).

  • Thomas_Ott
    Thomas_Ott New Altair Community Member

    @Telcontar120 The idea is for the end user to enter a value and then have webservice spit back a response and generate graphs (maybe via D3js!!) & stuff on the fly, so @SGolbert's lead to use AJAX is probably the way to do it on the front end.  The goal is to have a modern web interface that's mobile optimized, so Server dashboarding is not the way to go here. 

  • SGolbert
    SGolbert New Altair Community Member


    any update on this appliance? I want to learn how to do something similar, although I don't need it right now. I had the idea of exporting the data to plot.ly or Google Charts for more flexible charts.

    BTW The charts in the Server 9.2 seem to have changed a little, but they are still hardly customizable.

    Regards,
    Sebastian

  • sgenzer
    sgenzer
    Altair Employee
    @SGolbert so funny you should mention this - there was just some discussion about this yesterday internally here at RapidMiner. I'm going to cc @Marco_Boeck on this as he can likely give you better information.

    Scott

  • Marco_Barradas
    Marco_Barradas
    Altair Employee
    @Marco_Boeck , @sgenzer and @Thomas_Ott
    We have done things like this on a daily basis. Some of our dashboard are created by RM but exposed through other software. 
    You can expose the response and can protect it with a user that is set as service. 

    On the front your solution will call the webservice through a Curl call and you may get the HTML, JSON or XML depending on what you may want to use.

    Best Regards.