views:

55

answers:

2

I need to let a company push information up to my site.

The best way to explain what I am talking about is to explain how it is currently done with their previous website:

This company uploads a CSV file to an FTP set up by the website. The website then processes the CSV file and puts it into an SQL database so that it can be used by the website.

In this case, I am the website and I am working with the company. Both sides are willing to change what they do. So my question is...

What is the best way to accept batch information like this? Is there a more automated way that doesn't involve FTP? In the future I may have a lot of companies wanting to do this, and I'd hate to have to setup accounts for each one.

The project is C# ASP.NET MSSQL

Let me know if you need more information...

+3  A: 

Set up a web service to accept incoming data. That way you can validate immediately and reject bad data before it ever gets into your system.

RedFilter
I haven't ever setup a webservice, are there any resources you would suggest for learning how to do this?
Blankasaurus
Wouldn't it make more sense for the company to setup the web service?
Blankasaurus
Because multiple companies potentially want to send data to you, that makes you the single point of contact, so you should host the web service.
RedFilter
@Casoninabox: here's some links:(Web Service fundamentals) http://www.w3schools.com/webservices/default.asp(ASMX) http://www.15seconds.com/Issue/010430.htm(WCF) http://msdn.microsoft.com/en-us/netframework/first-steps-with-wcf.aspx(WCF) http://www.codeproject.com/KB/WCF/WCFWebService.aspxAs for books, Learning WCF and Programming WCF (Both O'Reilly) are good choices, but there's a few good ones that focus more on Web services than WCF (which is broader) http://oreilly.com/pub/topic/webservices
Veli
@OrbMan - Is there a name/descriptor for this receptacle web service so that I can delve in to it without bugging the good denizens of SO?
Blankasaurus
+1  A: 

If you want to eliminate FTP, you could allow them to upload files to your site leveraging using FileUpload. Once the file is uploaded you can do your server side processing.

EDIT: From the OP's comment's it seems to be an automated process. That said, if their process generates the file, you could:

Allow them to continue their current process which would involve them generating their file and placing it somewhere where it could be accessed via a URI with authentication, you could access this file on a schedule and process it. From what it seems right now they generate a file and upload it to your FTP server, so there seems to a manual element to begin with.

RandomNoob
Their process is automated to create a file and upload it every night. So I don't think they would be up for the extra overhead of doing something everyday.
Blankasaurus
Sorry, I didn't realize this was an automated process.
RandomNoob
+1, Thanks. How would you suggest scheduling the retrieval of this? Do I just need to write something that runs in the sys tray all the time and does it? ... I feel like people are shaking their heads at my ineptness.
Blankasaurus
You could write a Windows Service to periodically check the location. If you aren't comfortable with Windows Services you could certainly just write a console application that was scheduled via a Scheduled task
RandomNoob
From what I gather, the way to solve this, given that both sides can redign, would be to have the pusher of the data(company) write a webservice that basically serves up an authenticated XML file, and have the collector(me) have a windows service that connects to their webservice and gets the data on a schedule?
Blankasaurus
The do not need to write a web service, they probably have an existing method of generating the file, they just need to generate it and make it so that it can be accessed securely via an automated process, but as I write this its almost as if we're thinking of adding a layer of abstraction for something FTP was designed to do anyway. you can script ftp jobs as well.
RandomNoob