3

I'm developing a RESTful API for a client. The problem is, he's using a rather obscure language called Clarion. It's proprietary and closed, and the docs are not freely available online.

Whenever we discuss passing data from his code to mine, and back again, he starts talking about "ftp file uploads" and direct server-to-server SQL. Needless to say, these ideas bring back visions of the bad old days. I have done some googling, and I can't find any evidence that this language is capable of creating HTTP Post requests at all, let alone using SSL encryption to protect them from prying eyes.

I'm looking for advice specific enough that I can guide him through implementing his end of the bargain. I specifically want to avoid trying to pass XML requests as files via FTP, or by writing them to the disk and calling some script. It should go without saying, but I'm also not interested in running proprietary clarion server code or DLLs on my server.

Is Clarion capable of generating POST requests? Is XML hard to generate in Clarion? Is there a simpler/easier to use format my client may have more sucess with? None of the data is more complex than key/value pairs.

I'm coding in python, but I can deserialize any reasonable data format if there's some way to get the data to my server.

Paul McMillan
  • 19,693
  • 9
  • 57
  • 71
  • Clarion is an excellent development tool and you can do anything you want with it. The third party tools like the ones Bruce is talking about speed up the process and hide the complexity associated with the programming. In the end you get a compiled binary that can be distributed to Windows machines and will run rock solid. – Kenny Smith Jul 08 '18 at 04:51

4 Answers4

6

I feel your pain. Communicating between systems can be a major pain. Good news though is that Clarion can do TCP/IP, and XML (with a little help) so there's nothing that should hold your Clarion colleague back.

In the interests of full disclosure I should point out that I'm biased here - I'm about to recommend that the Clarion guy use tools I created - nevertheless there are thousands of Clarion programmers out there using them, and they provide the answer to your question, so please forgive me. Ignore if you like.

In Clarion there are a couple of tools that make TCP/IP communications easy and that enable the use of SSL. The one I make is called NetTalk (http://www.capesoft.com/accessories/netsp.htm).

There is also XML support inside the Clarion box, although it's unnecessarily cumbersome so there are at least 2 xml products he can use - iqXML (which is free) and xFiles (http://www.capesoft.com/accessories/xfilessp.htm) which is designed to be super fast.

Using NetTalk & xFiles together it's trivial to create SOAP servers or clients. (Or plain HTTP servers and clients as you prefer.) There are a LOT of folk doing just this, so there's absolutely no excuse for using shared files, or FTP'ing requests around. I recommend you gently point your Clarion friend in the right direction.

If you'd like to run this question past other Clarion developers then try http://faq.clarionmag.com/ (which is using the StackOverflow engine.) There are also lots of programmers active on the NNTP protocol (news) at news.softvelocity.com (comp.lang.clarion and others).

Cheers Bruce

Bruce
  • 911
  • 2
  • 7
  • 12
  • Thank you Bruce! this is exactly the answer I needed but (unfortunately) can no longer accept. I guess an upvote will have to do. I'll definitely be passing this info along, and appreciate the pointers to more active Clarion communities. – Paul McMillan Dec 16 '09 at 06:25
0

Instead of trying to accomplish more in this obscure language, I'd go with the approach that you hinted upon: using the file system as a hand-over mechanism.

Have his code output files to a given folder; then, have a daemon, written in a "normal" language, monitor that folder regularly (cron job, etc). When a new file shows up, upload it through HTTPS / other "normal" means to your other server to do the task.

This approach follows the "localize the crap" philosophy - if you can't get rid of crap, at least make sure that it's "borders" are well defined.

Alex Weinstein
  • 9,823
  • 9
  • 42
  • 59
  • This really isn't an option here. I don't have control over the install process, and making it more complex than it already is just isn't an option. – Paul McMillan Dec 04 '09 at 22:22
0

Information wants to be free. The language may be proprietary and closed, but the documentation is published online:

http://www.softvelocity.com/clarion/pdf/LanguageReferenceManual.pdf

Looks like a Windows 3.1 vintage report generating language which has the ability to talk DDE/OLE (!), but seems to have no external communication features other than that.

So no, Clarion cannot do POST requests (except via a third party custom control / DDE conversation). Using the file system might be a safe way to proceed: it keeps the client in familiar territory, and is the easiest to debug. However, if two way communication is required, you might need to blow the dust off the manuals and go the DDE route. It really depends on the exact requirements (e.g. is the program batch or interactive?), but page 935 (Appendix A) in the 1158 page manual is where to start looking!

MZB
  • 2,071
  • 3
  • 21
  • 38
  • Information may want to be free, but that manual is for version 6, not 7, and is about 6 years old now. I presume version 7 has more features, but I don't have the docs for it. – Paul McMillan Dec 06 '09 at 19:26
  • 1
    One small point here, just to correct some possible misconceptions. Clarion is a business orientated language with strong functionality WRT reading and writing data, so more than a report generating language. The language has it's roots in DOS circa 1984 with the Windows version debuting circa 1994. Because it is a native compiled language, it has access the whole Windows Win32 API and is not limited to the functions in the doc you read. So native Clarion can do POSTS simply by using the Winsock API, or indeed the WinINet DLL. – Bruce Dec 16 '09 at 07:07
0

I came in very late to this post, for I only had Stack Overflow account set today. However, I would like to comment on Bruces answer.

Bruce runs a 3rd party Clarion add on maker company and will always suggest the use of their products. Altough they're really fine an work very well, I can't help pointing that there are standard, open tools for about anything that needs to be done.

For example, the programmer could use "curl" http://curl.haxx.se/ to communicate with a web server from a program. Not only a Clarion program, but any program. Aside from that, Clarion does have access to all the Windows API, and it is just a matter of writing the code, so, sockets, http, mci and whatever are at any programmer's reach.

Need to send e-mail from a program that apparently doesn't have access to smtp functions? use "Blat"! - blat.net

Want to download some file from a web site? wget - gnu.org/software/wget

These are all command line interfaces. And I suggest the ones who don't know what "interface" means, to go get a look at The Free Dictionary - tfd.com/interface

Regards

Pinsard
  • 31
  • 2
  • Thanks for your answer, but as I specified in the question, I'm looking for a NATIVE solution. Anything which makes deployment more complex is out (curl, extra command line tools, etc.). Also, I'm not sure why you're insinuating that I don't know what the word interface means. – Paul McMillan Jan 29 '11 at 01:16