views:

159

answers:

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.

A: 

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
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
A: 

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
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
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
+2  A: 

Hi Paul,

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
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