Post #204,815
4/25/05 10:05:38 PM
|
C# -> Linux Perl RPC?
I want to come up with the simplest method of doing RPC calls from Windows to Linux.
The Linux side will execute my Perl code to access data, run programs, read/write files, etc, ie: full access.
The Windows side will be running an application written in C#.
There needs to be a bit of security, but I don't need to encrypt EVERYTHING. On the other hand, I certainly don't want to write a deamon that listens on a port and executes anything thrown at it.
While I seem to recall there is a variety of methods to do this, I have very little experience with this type of interaction.
I've cheated using Postgresql. Using ODBC or .NET drivers, you can access my Postgresql database. Postgresql allows me to run Perl code internal to the database, but this feels a bit dangerous to me since all Perl code executes as the Postgres user at that point.
So, in order of importance: Run perl code on Linux. Is invokable via a C# program on windows. Has some type of authentication. Has enough security to fool a sniffer. Requires minimal components to confuse me or make it difficult to hand off to someone else to support.
Should I stick with my Postgresql hack?
|
Post #204,819
4/25/05 11:32:30 PM
|
RPC means...?
What kind of data volume and rates are we talking about? Is this something that can be done using the "pretend I'm a web client" APIs in C# on the client side, and some CGI scripts on the server using Apache and SSL? It's easy to use basic authentication, and SSL makes that snooper-proof.
|
Post #204,823
4/26/05 2:57:03 AM
|
Re: RPC means...?
Remote Procedure Call - a way of allowing an outside source to run an 'executable' on a box. Both Unix and most databases support them.
Not sure if Postgres supports it or not.
|
Post #204,825
4/26/05 3:12:48 AM
|
When you hear "RPC", it makes sense to ask about context
There's classic RPC, and there's the "RPC" used as a general label for "I'm here, and I need to get a message to there (and maybe back)". There are a bunch of approaches the the latter problem, depending on those pesky details.
|
Post #204,829
4/26/05 6:48:51 AM
|
Low volume - interactive
Almost all of my code resides on world of Linux back-end. Occasionally I need to create a user interface - which I've done lately in C#.
The back-end Linux code is almost always Perl, but will interact with a variety of 3rd party programs.
So (for a trivial example), I need to create a C# interface that queries that status of a back-end production, and this status is an aggregation of Linux stuff (load average, SGE queue size, plus some information in some log tables currently in Postgresql).
My 1st instinct is to create a Perl program on the Linux size, and have it produce some clearly defined text strings on output. This is then callable from any command line.
I would then need to hand this data off to the C# side, since it would be invloked by a user pressing a button, querying the status of the system. I would want the C# to format and present it, since I hate web presentation/interaction and these are all in-house windows clients.
Based on what you said, it seem a CGI interface a decent answer.
Hm - what about SOAP?
|
Post #204,830
4/26/05 7:07:13 AM
|
SOAP is a dirty word
Way far over complex for what you need, by the sounds of it. Of course, SOAP is over complex for just about everything.
Just use a simple POST/response interface, and you'll be all happy and stuff.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #204,843
4/26/05 11:05:43 AM
|
REST in the ease of HTTP
[link|http://en.wikipedia.org/wiki/REST|http://en.wikipedia.org/wiki/REST]
|
Post #204,873
4/26/05 1:39:57 PM
|
Yep, that's what we support here.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #204,872
4/26/05 1:38:27 PM
|
Agreed
[link|http://www.perl.com/pub/a/2004/09/30/drop_the_soap.html|Don't be afraid to drop the SOAP] says it all, from the perspective of someone who loves XML.
Note, SOAP used to stand for Simple Object Access Protocol. It now stands for nothing because people couldn't stand the irony, seeing as how it isn't simple and no objects are involved.
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #204,874
4/26/05 1:40:08 PM
|
Irony can be so ironic...
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #204,878
4/26/05 2:03:33 PM
|
Sure it stands for something
Stupid Object Access Protocol
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #204,881
4/26/05 2:10:59 PM
|
Come on, you can do better than that:
Suppuration Of Access Predicament Sent Objects Are Punted Software Originators Aren't Pleased
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #204,883
4/26/05 2:15:30 PM
|
I suppose
Syntactic Obfuscation/Augmentation Protocol
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #204,886
4/26/05 2:27:57 PM
|
ROFL
|
Post #204,888
4/26/05 3:43:09 PM
|
That works
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #204,885
4/26/05 2:20:34 PM
|
Surely Over Agitation Pleases
;-)
Peter [link|http://www.ubuntulinux.org|Ubuntu Linux] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #204,891
4/26/05 4:34:35 PM
|
Simple Operations Are Perplexing
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #205,319
4/30/05 12:08:30 PM
|
OT: could you get rid of the animation in your icon
It keeps attracting my eyes and distracting me...
------
179. I will not outsource core functions. -- [link|http://omega.med.yale.edu/~pcy5/misc/overlord2.htm|.]
|
Post #205,328
4/30/05 2:27:43 PM
|
Use your browser features to disable that.
If your browser doesn't allow you to do that, then get a better browser.
-YendorMike
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759 Historical Review of Pennsylvania
|
Post #205,358
4/30/05 5:57:05 PM
|
Somewhat changed.
|
Post #205,361
4/30/05 6:08:46 PM
|
Oh yeah, that's just lovely (new thread)
Created as new thread #205360 titled [link|/forums/render/content/show?contentid=205360|Oh yeah, that's just lovely]
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #206,149
5/5/05 7:14:35 PM
|
I recently had to do something like that.
The problem was that the database had a comprehensive set of APIs to manipulate things. Unfortunately, the API was a PHP library on a web server and an application written in another language on another platform needed to access this.
I considered SOAP and XML-RPC but PHP's support for either was experimental, badly documented and required additional libraries. OTOH, elementary XML parsing was built-in. So I rolled my own interface. A 500-line PHP script accepts a specially constructed POST containing an XML-encoded function call, calls the function, and returns the data in the same type of XML. It has a list of allowed functions that it exposes this way to control what can be done and it leverages the login mechanism used on the rest of the site to prevent any random user calling it. The programmer who calls it loves it's versatility. By the end of the development, I was just adding extra function calls for him in its allowed list.
Wade.
Is it enough to love Is it enough to breathe Somebody rip my heart out And leave me here to bleed
| | Is it enough to die Somebody save my life I'd rather be Anything but Ordinary Please
| -- "Anything but Ordinary" by Avril Lavigne. |
|