views:

138

answers:

8

Here is an interesting combination, I need to transfer data between an "appliance" running Windows XP Home and a remote Linux server on the internet. Let me itemize what needs to happen:

  1. The "xp home" system needs to transfer data or files every 30 minutes or so. (sftp?)
  2. The Linux server need to contact the "XP Home" system to request data.

Seems simple enough eh? I was thinking about using web services on the Linux side and thought It would be nice to do the same on the XP Home system. But some of my research says that won't work on XP Home for answering incoming web service calls. Maybe that's wrong? So what about RESTful services will that do the trick?

BTW: Since this is a new application I can do the development on both ends. C# on the Windows side and Java on the Linux side.

Ideas are appreciated!

+1  A: 

why not use Java on the Windows side as well? Tomcat should run on any XP.... this will take care of your other question as well.

Tetsujin no Oni
I like it. "Iron Demon", like "Iron Chef", no?
Charlie Martin
demon of iron men - played too much Battletech in the 90s...
Tetsujin no Oni
A: 

Okay, so the protocol over all is

  1. Linux system contacts the Windows system to request data
  2. Windows system replies with data.

How much data, and what type?

It would seem, first thought, that you just run a web server on the Windows box and respond with data. I haven't built one, but there are lots of web servers that support Windows.

Charlie Martin
At first the data to transfer every 30 minutes or so could be 2 meg or so. But when the Linux system does a request for the data it'll be small like 2K or less.
Rick
Ooops, didn't answer your question - type is binary data.
Rick
Okay, really, look at using a web server. Assuming you have any kind of decent communications, even 2 MB won't take long. you automatically get threading, you automatically can have encryption, and the request can be done off the shelf in Java using HTTPURLConnection. http://java.sun.com/j2se/1.5.0/docs/api/java/net/HttpURLConnection.html
Charlie Martin
+1  A: 

XP Home doesn't include IIS, but you can install a different web server and use it on the Windows side. Another option would be to do some simple sockets programming on both ends to facilitate the requests from the Linux box to the XP box. That approach doesn't scale well, but if you're looking to put something together quickly, it would work.

Scott Ewers
Yes, I was looking at doing a simple TCP client/server for both ends, then I thought about open ports, and needing to develop it to protect against hacking..... welll, I can start that way and when I leave the company in a few years hand it off to the next guy! :) just kidding.
Rick
+2  A: 

Since the application is new and if you need a strong real time data share I could recommend you to use shared database. You can install on one of these hosts.

Any way web services solution is too complex. Use the same technology on both machines and you will be able to use the language-specific features of the language you choose.

Bogdan Gusiev
A: 

Another solution would be using something message based, like JMS or XMPP. Since it is over the internet, XMPP might be a better fit.

XMPP chat messages can be used for handshaking and it has filesharing extensions to do the binary transfers.

Also, you can use the language of you choice to implement either end, as there are libraries available in all popular languages.

Edit: Supposedly, Tivo now uses it to send send updates to the Tivo boxes from their servers.

Robin
+1  A: 

If you don't truly need real-time.

A low tech solution may be to get the Windows appliance to poll the Linux box at regular intervals. It could send data and ask the Linux box if there is anything it needs.

This would obviate the need for incoming ports to be open on the windows side (which may not be desirable or possible).

Fortyrunner
A: 

Another solution would be to just have the XP side connect to a java servlet and pass the data as JSON. It is probably the simplest approach, as it requires you to just secure the java side and JSON is very easy to parse, and in my tests it ended up being faster for my needs than using a webservice.

If you need to have the java side request, then just listen on a port just to be informed that data needs to be sent, and then send the data to the servlet. It would be a simple server on the XP side as it doesn't transfer any data, just gets a tiny message ('send').

James Black
+1  A: 

Install Cygwin on the Windows server, install an SSH server and make sure rsync is installed. On the linux side call rsync via a cron job. No programming / design required.

Jherico
I've used rsync in other applications and it works well and I like your idea for it's simplicity. However I'II have to mull over how to get the real time data back on demand, (ie. from visiting a webpage and click a link). I like it - very simple.
Rick