Ajax with Service Programs

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Ajax with Service Programs

Post by mwalter »

Is there a way to make an Ajax call using a sub-procedure in a service program. Or do I need some sort of "handler" to direct the call to the correct service program?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Ajax with Service Programs

Post by Scott Klement »

Its not clear under what circumstances you're trying to do this, but..

1) Web pages (including those made with Profound UI) can make AJAX calls. The Apache web server is able to run RPG programs (as well as many other languages, or other things like files, etc) when you call a URL, other web servers may have other capabilities. Yes, of course, those RPG programs can call a subprocedure if they want. But, Apache does not provide a way to call a subprocedure directly, you must call a program, which in turn could call a subprocedure. Is that what you're asking?

2) Can you use a "handler". This one has been confused, as I don't know what you mean by "handler" in this context. Are you referring to an open access handler, or a different type of handler? What does that have to do with AJAX calls? Clarification here would be useful, as I'm not familiar with the circumstance you're in. I don't know where/what you're tryig to do, and so I don't understand what you mean by this at all.
mwalter
Experienced User
Posts: 140
Joined: Wed Sep 14, 2016 2:58 pm
First Name: Mark
Last Name: Walter
Company Name: Paragon Consulting Services
Contact:

Re: Ajax with Service Programs

Post by mwalter »

Thanks Scott. You're first explanation iterated what I thought.

I have a service program that does field validation of sorts. Those sub-procedures are called from RPG. I was wondering if you could do something akin to an SQL Function with Ajax. I'm guessing no.

The handler is sort of like a traffic cop. You, pass it a function name, and a list of arguments, and based on the function name, it'll parse the arguments and call the correct sub-procedure. I've had to do this with PHP when I've used a PHP class.

Ultimately, I believe, a Universal Display file would be ideal here. But, we haven't upgraded to that level yet.
Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests