Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Delph Pro REST is easy. Now, WebSockets & Deployment?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Last Post: Jun 15, 2017 4:20 PM Last Post By: James Fielland
James Fielland

Posts: 32
Registered: 4/22/97
Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2017 1:45 PM
My previous query was how to build REST CGI with Delphi & the answer is easy with Pro Version with a very clear an easy presentation by Embarcadero’s Craig Chapman’s YouTube video: “Building RESTful servers. In Delphi.” And you can download the full source for his REST Server.

Next Step: My Ap is converting a Windows Ap I built. It is technical, engineering-type design stuff, no DB’s, just logic & math. The Client (HTML, CSS & Javascript . . . +Grrr!!! Whoever killed Java Applets for this stuff should be hung+) is built & only needs to communicate with the complex part (Delphi on the server). The Client page is fixed (just updated) & looks like a Windows Ap.

User mostly clicks things, gets response & clicks more options, round & round till design complete then gets a report. I would like response ASAP as though desktop Ap. THUS:

1. Can I add Web Sockets to the WebBroker Module to speed up reply/response? My Ap it’s all logic & math, no database, but complex enough & existing code, the logic remains on the server. The Client (Browser) sends info on a click & I need to respond ASAP so he can click again, repeat over & over till entire engineering-type design complete when I finally generate a report (pdf probably) to send. User operating from fixed web page looking & acting like a desktop Ap.

2. If Web Sockets are OK to use, does it matter much whether it is a CGI.exe or an ISAPI?

Deployment:

1. My plan is to install Ap on a VPS server hosted by, say, GoDaddy. Some commenters say no hosting company will allow me to install an ISAPI. Is that so? (GoDaddy tech guys don’t seem to know much about it).

2. My understanding is that an ISAPI is the best, but that IIS must be brought down & back up to update the ISAPI as the dll becomes part of IIS. Is that so? If so, will a VPS hosted by GoDaddy (et al) allow me, the user, to start & stop IIS?

3. Microsoft has a Web Page on installing ISAPI’s on IIS & it is more steps that any want to count. It does not look easy & tiny errors setting up this kind of stuff can take enormous time to find out why your stuff does not work. Where can I hire a techie to help me get IIS set up & my Ap running? GoDaddy tech does not seem to know much.
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2017 2:59 PM   in response to: James Fielland in response to: James Fielland
James Fielland wrote:
My previous query was how to build REST CGI with Delphi & the answer is easy with Pro Version with a very clear an easy presentation by Embarcadero’s Craig Chapman’s YouTube video: “Building RESTful servers. In Delphi.” And you can download the full source for his REST Server.

Next Step: My Ap is converting a Windows Ap I built. It is technical, engineering-type design stuff, no DB’s, just logic & math. The Client (HTML, CSS & Javascript . . . +Grrr!!! Whoever killed Java Applets for this stuff should be hung+) is built & only needs to communicate with the complex part (Delphi on the server). The Client page is fixed (just updated) & looks like a Windows Ap.

User mostly clicks things, gets response & clicks more options, round & round till design complete then gets a report. I would like response ASAP as though desktop Ap. THUS:

Hmmm... it actually sounds like you are looking for Intraweb.

You can build the user interface in IW and use your existing Delphi code. IW is included with Delphi, though for deployment you'll probably want to upgrade for more control over the deployment. The good news is that you can build and test your app quickly and then decide. Conversion of an app like you describe is going to be quick and easy.

If you have questions, ask questions in the IntraWeb section of this forum (Delphi>Third Party Tools> Intraweb)
https://forums.embarcadero.com/forum.jspa?forumID=93&start=0

Dan

Dan

James Fielland

Posts: 32
Registered: 4/22/97
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2017 3:24 PM   in response to: Dan Barclay in response to: Dan Barclay
Dan Barclay wrote:
James Fielland wrote:
My previous query was how to build REST CGI with Delphi & the answer is easy with Pro Version with a very clear an easy presentation by Embarcadero’s Craig Chapman’s YouTube video: “Building RESTful servers. In Delphi.” And you can download the full source for his REST Server.

Next Step: My Ap is converting a Windows Ap I built. It is technical, engineering-type design stuff, no DB’s, just logic & math. The Client (HTML, CSS & Javascript . . . +Grrr!!! Whoever killed Java Applets for this stuff should be hung+) is built & only needs to communicate with the complex part (Delphi on the server). The Client page is fixed (just updated) & looks like a Windows Ap.

User mostly clicks things, gets response & clicks more options, round & round till design complete then gets a report. I would like response ASAP as though desktop Ap. THUS:

Hmmm... it actually sounds like you are looking for Intraweb.

You can build the user interface in IW and use your existing Delphi code. IW is included with Delphi, though for deployment you'll probably want to upgrade for more control over the deployment. The good news is that you can build and test your app quickly and then decide. Conversion of an app like you describe is going to be quick and easy.

If you have questions, ask questions in the IntraWeb section of this forum (Delphi>Third Party Tools> Intraweb)
https://forums.embarcadero.com/forum.jspa?forumID=93&start=0

Dan

Dan


I’ve already built the GUI user interface in HTML/CSS/Javascript & it looks good & runs fine. Now I need to write JavaScript Post/Response on that portion & the corresponding Read/Write (or whatever you call it) on the server. I’m an independent developer mostly working alone for multinationals & the project is for one such converting a Win Ap already written. The only Web Ap I ever developed was a Java Applet, which was the primary tool for scientists & engineers in & out of gov. But the Web has gone HTML/CSS/JS & Web Servers & I’m a novice (AND ANNOYED at how hard it seems to be vs Java Applets of old).

(An aside which I think I can do with a little more research, is to xfer binary between the Browser’s JavaScript & my Delphi server as the info is not intended for human consumption & binary data would be faster & easier on my Delph side).

IntraWeb: Sounds plausible. Over time I’ve read a little about it & browsed some. Assuming I’ve developed an Ap, the result will be, say, TexsService.exe. What do I do with that? Is it a CGI? Is it an ISAPI if I compile it to TexsService.dll? Does it run under IIS, Apache? Will GoDaddy (or other hosting company) let me run it? How is TexsService.exe/dll related to IIS, Apache and the Web Hosting Co? Maybe I should go over to IntraWeb section to ask this, but if it's an easy answer, maybe this will do.

Thanks,

Brgds,
--tex
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2017 3:49 PM   in response to: James Fielland in response to: James Fielland
James Fielland wrote:
Dan Barclay wrote:
James Fielland wrote:
My previous query was how to build REST CGI with Delphi & the answer is easy with Pro Version with a very clear an easy presentation by Embarcadero’s Craig Chapman’s YouTube video: “Building RESTful servers. In Delphi.” And you can download the full source for his REST Server.

Next Step: My Ap is converting a Windows Ap I built. It is technical, engineering-type design stuff, no DB’s, just logic & math. The Client (HTML, CSS & Javascript . . . +Grrr!!! Whoever killed Java Applets for this stuff should be hung+) is built & only needs to communicate with the complex part (Delphi on the server). The Client page is fixed (just updated) & looks like a Windows Ap.

User mostly clicks things, gets response & clicks more options, round & round till design complete then gets a report. I would like response ASAP as though desktop Ap. THUS:

Hmmm... it actually sounds like you are looking for Intraweb.

You can build the user interface in IW and use your existing Delphi code. IW is included with Delphi, though for deployment you'll probably want to upgrade for more control over the deployment. The good news is that you can build and test your app quickly and then decide. Conversion of an app like you describe is going to be quick and easy.

If you have questions, ask questions in the IntraWeb section of this forum (Delphi>Third Party Tools> Intraweb)
https://forums.embarcadero.com/forum.jspa?forumID=93&start=0

Dan

Dan


I’ve already built the GUI user interface in HTML/CSS/Javascript & it looks good & runs fine. Now I need to write JavaScript Post/Response on that portion & the corresponding Read/Write (or whatever you call it) on the server. I’m an independent developer mostly working alone for multinationals & the project is for one such converting a Win Ap already written. The only Web Ap I ever developed was a Java Applet, which was the primary tool for scientists & engineers in & out of gov. But the Web has gone HTML/CSS/JS & Web Servers & I’m a novice (AND ANNOYED at how hard it seems to be vs Java Applets of old).

(An aside which I think I can do with a little more research, is to xfer binary between the Browser’s JavaScript & my Delphi server as the info is not intended for human consumption & binary data would be faster & easier on my Delph side).

IntraWeb: Sounds plausible. Over time I’ve read a little about it & browsed some. Assuming I’ve developed an Ap, the result will be, say, TexsService.exe. What do I do with that? Is it a CGI? Is it an ISAPI if I compile it to TexsService.dll? Does it run under IIS, Apache? Will GoDaddy (or other hosting company) let me run it? How is TexsService.exe/dll related to IIS, Apache and the Web Hosting Co? Maybe I should go over to IntraWeb section to ask this, but if it's an easy answer, maybe this will do.

Intraweb lets you create an app as either (1) standalone webserver (2) webserver as a service (3) ISAPI (4) ASPX. Generally you'll want to create your app using the standalone (built in) webserver then just build an ISAPI or ASPX when you are ready. That allows you to debug the entire app in the Delphi IDE, which is huge. The standalone is an exe, which operates as a webserver built on Indy. You can mix javascript of your own (which gets pushed down to the client) if you wish, but you can also build the entire thing on the Delphi side. Heck, create an app with the wizard in Delphi then bring it up and have a look. I think the defaults will give you a standalone webserver. If I recall, the "free" one in Delphi has a fixed port and is limited to the standalone but that's not a problem for development. http://www.atozed.com/intraweb/features/

IW also allows you to create web pages as templates, then have those templates use the controls you set up. CSS is also supported (it's html5).

FWIW, I have an IW app that also provides web services (you can create custom content handlers for that).

Dan

Edited by: Dan Barclay on May 25, 2017 5:50 PM
ib elfving

Posts: 33
Registered: 8/28/01
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 10, 2017 12:35 PM   in response to: Dan Barclay in response to: Dan Barclay
Hi Dan,
Like you, i have implemented webservices in a content handler, but implementing a rest server seems quite hard. My webservices is currently called with ordinary post and queries parameters, and that works like a dream, but if the call is done by a rest client (ip*works or indy) - with a json og xml as parameter, the parameter disappears. I can't get these anywhere. Have you solved this problem?
regards ib
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 10, 2017 8:31 PM   in response to: ib elfving in response to: ib elfving
ib elfving wrote:
Hi Dan,
Like you, i have implemented webservices in a content handler, but implementing a rest server seems quite hard. My webservices is currently called with ordinary post and queries parameters, and that works like a dream, but if the call is done by a rest client (ip*works or indy) - with a json og xml as parameter, the parameter disappears. I can't get these anywhere. Have you solved this problem?
regards ib

The CustomContentHandler allows you to create your own handler for specific requests and send a response of your own making.

I haven't created a server that speaks JSON, but in a CustomContentHandler you will find the parameters in aRequest.Query. You'd have to handle the JSON parsing yourself, and I don't have any advice for you on that. Other than that, it should be fairly straightforward.

You may want to play around with the IW sample code for the CustomContentHandler. That will allow you to manually create your own request and reply strings to build up a simple app that works.

Dan
James Fielland

Posts: 32
Registered: 4/22/97
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2017 4:20 PM   in response to: ib elfving in response to: ib elfving
ib elfving wrote:
Hi Dan,
Like you, i have implemented webservices in a content handler, but implementing a rest server seems quite hard. My webservices is currently called with ordinary post and queries parameters, and that works like a dream, but if the call is done by a rest client (ip*works or indy) - with a json og xml as parameter, the parameter disappears. I can't get these anywhere. Have you solved this problem?
regards ib

ib: FWIW, Delphi's WebBroker is especially designed for json & the Chapman video mentioned in my first post is excellent, showing you how to build & test it. He's just made another video showing how to install a WebBroker ISAPI dll application in IIS which is no easy feat by only googling such task. Like the previous video, he's done a great job making it easy.

Hope this helps.
--tex
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Delph Pro REST is easy. Now, WebSockets & Deployment?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 25, 2017 11:01 PM   in response to: James Fielland in response to: James Fielland
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02