What methods are there to send read/ write a file from one machine to another? - asp.net

Using asp.net what non http / ftp methods are there to read a file from one machine and write it back from another?
For example i have an image on machine A called test.JPG. Machine B should be able to grab a copy of test.JPG generate a thunmbail and send it back to Machine A.
I've looked at the following solutions but unsure which if it's architecturally sound
Machine A
Set up a WCF web service
with read / write operations
Machine B
Set up a WCF service to read and write
files from the WCF service on machine
A
Part of the problem is that Machine B needs to know when there are files on Machine A to be processed. What kind of setup do i need on both machines to enable this? Initially i am thinking of polling for files on Machine A.
I am unsure of the above setup so please help me improve it, particularly if WCF is suitable for this kind of work.

If copying files is the only thing you need to do, you might be able to save yourself some trouble and use pre-written software. I'm thinking of software that's designed to replicate files between load-balanced web servers.

Related

How to migrate data to Alfresco from Ftp servers as data sources?

The Situation: I'm going to implement a digital repository using alfresco community version 5.1 to manage our university digital content which is stored at a moment in differents ftp servers (software installers, books, thesis). I intent to use alfresco as a backend and Orchard CMS as our intranet frontend which is a non functional requierement and communicate both with CMIS. The general idea is that we use a social networking approch in which every user can modify metadata, add tags in order to improve the search, which by the way is the general objective of my work (allows searches and download to the digital content of our intranet , because right know it takes a lot of time to find anything because it is storage in a ftp server without a good cataloging).
I already successfully created a custom data model but when a decided to migrate the content from these ftps, i didn't find any documentation about it. I read about bulk import tool but it happent that i need the data locally in the same computer that runs alfresco, and as i said, the data source are different ftp server.
So How can i migrate data from differents ftps servers as datasource to Alfresco?. Is it necessary to physically import files to Alfresco or can i work with index pointing to the ftp files (keep the files in the ftps and have in Alfresco a reference of that object (I only have search and download functional requierements))?.
Please I need your help as a guidence because here in cuba we dont have experience working with Alfresco and it is very difficult to have access to internet. So if you can point out the way of fixing this, or any recommendation i will be forever greatfull. Thank You and Again so sorry to disturb You
If this were a one-time thing, you could use an FTP client of some sort to simply drag and drop the files from your FTP server into Alfresco's FTP server. This would copy the files only and would not set any custom metadata.
Alternatively, you could write some Java to do this. Java can read from FTP servers and can write to Alfresco via CMIS. This would give you the opportunity to set some properties on the objects written into Alfresco beyond just the file name, creation date, and modification date.
However, if you are going to do this regularly, you might want to look at an integration tool. For example, you could use Apache Camel to watch the FTP servers, and when there is a change, it could fetch the file and write it to Alfresco via CMIS.
This will likely take some coding to make it work exactly right, but hopefully this gives you some options to consider.

Use fake domain locally in Visual Studio without modifying the host file directly

I have an application that runs here http://localhost:10205/ but I need it run locally as http://somethingelse.com/.
This needs to happen on other computers as well without the need to alter the host file.
How do I do that?
If you are all within the same network, you can add an A Record to your domain controller. Beyond that, there's not much you can do when you're dealing with multiple endpoints. As far as actually performing that task, you may want to discuss on serverfault.

How to avoid chaotic ASP.NET web application deployment?

Ok, so here's the thing.
I'm developing an existing (it started being an ASP classic app, so you can imagine :P) web application under ASP.NET 4.0 and SQLServer 2005. We are 4 developers using local instances of SQL Server 2005 Express, having the source-code and the Visual Studio database project
This webapp has several "universes" (that's how we call it). Every universe has its own database (currently on the same server) but they all share the same schema (tables, sprocs, etc) and the same source/site code.
So manually deploying is really annoying, because I have to deploy the source code and then run the sql scripts manually on each database. I know that manual deploying can cause problems, so I'm looking for a way of automating it.
We've recently created a Visual Studio Database Project to manage the schema and generate the diff-schema scripts with different targets.
I don't have idea how to put the pieces together
I would like to:
Have a way to make a "sync" deploy to a target server (thanksfully I have full RDC access to the servers so I can install things if required). With "sync" deploy I mean that I don't want to fully deploy the whole application, because it has lots of files and I just want to deploy those new or changed.
Generate diff-sql update scripts for every database target and combine it to just 1 script. For this I should have some list of the databases names somewhere.
Copy the site files and executing the generated sql script in an easy and automated way.
I've read about MSBuild, MS WebDeploy, NAnt, etc. But I don't really know where to start and I really want to get rid of this manual deploy.
If there is a better and easier way of doing it than what I enumerated, I'll be pleased to read your option.
I know this is not a very specific question but I've googled a lot about it and it seems I cannot figure out how to do it. I've never used any automation tool to deploy.
Any help will be really appreciated,
Thank you all,
Regards
Have you heard of the term Multi-Tenancy? It might be worth look that up to see if that applied to your "Multiverse" especially if one universe is never accessed by another...
See:
http://en.wikipedia.org/wiki/Multitenancy
http://msdn.microsoft.com/en-us/library/aa479086.aspx
UPDATE:
If the application and database is the same for each client (or Tenant) I believe there are applications that may help in providing the same code/db as an SaaS application? ie another application/configuration layer on top that can handle the deployments etc?
I think these are called Platform as a Service (PaaS) applications:
see: http://en.wikipedia.org/wiki/Platform_as_a_service
Multi-Tenancy in your case may be possible, depending on client security requirements, with a bit of work (or a lot of work):
Option 1:
You could use the one instance of the application, ie deploy the site once and connect to a different database for each client. You would need to differentiate each client by URL to isolate content/data byt setting a connection string for each etc. (This would reduce your site deployments to one deployment)
Option 2:
You could create both a single instance of the application and use a single database. You would need to add a "TenantID" to each table and adjust all your code to accept a TenantID to ensure data security/isolation. Again you wold need to detect/differentiate the Tenant based on the URL to set the TenantID for the session used for every database call. (This would reduce your site and database deployment to one of each)

Where to start with web service development?

I am currently working on a project that is very new to me, and I feel a bit over my head as far as knowledge base is concerned. My request is for references and information to help me expand my knowledge base, as well as recommendations for technologies and methods.
I have experience primarily with Java, so all this Windows service stuff is new to me. I am not really asking for a how-to (but if someone has time....I wouldn't object :-P)
The project is as follows:
I am to develop an application in ASP.NET that runs as a process from start-up to shutdown. It will be checking some things in a folder, encrypting some files from that folder, and then check if internet connectivity is available. If it is available, it will be sending those files to a server (via a web service on that server, I believe). If it is not available, it will check every 'insert time interval here' to see if connectivity has become available, at which time it will send the files. Once the files are received by the service, the application will need to recieve some kind of confirmation from the server that the file associated with 'xxxxxxxxxxxxx' uniqueidentifier has been received.
Any explanation of the way that web services work or how to implement file encryption in a desktop app (resource load optimization is a very substantial requirement of this app).
Thanks!
badPanda
There are a couple of things going on here. First off it sounds like you are trying to write a service. Assuming you are writing code for Windows, and that code needs to run regularly and perform some tasks, and you want it to start and stop automatically when the computer is starting or shutting down, a service is ideal for this kind of task. Writing a service isn't too different from writing a normal application except that it has a few extra parts to allow the operating system to control it, and it typically has no user interface.
As far as interacting with a web service goes, typically a web service has a published WSDL (Web Services Description Language) which is just a fancy XML file that contains a description of the service. Most moden programming tools have a feature that loads a WSDL file and creates an object that communicates with the service for you. Then its as simple as creating an instance of that client object and calling the appropriate method. Typically using this created object is as simple as calling normal code, and the object does all the work of converting your parameters to a message, sending them over the network, waiting for the response, and converting the response from the web service back into a return value your client can read.
Encryption methods are going to vary based on operating system and programming language. To get any serious kind of answer you are going to have to add more details.
Really all of this is stuff you should be able to find with google, but one of the ironies of search is sometimes you can't find what you are looking for unless you already know what it is called. Try matching up terms like 'Windows Service' with your programming tools and throw in the word tutorial and you should find lots of good stuff to read. So if you are using Visual Studio and C#, a search like 'Windows Service Visual Studio C# Tutorial' should get you exactly what you need.

How do I cluster an upload folder with ASP.Net?

We have a situation where users are allowed to upload content, and then separately make some changes, then submit a form based on those changes.
This works fine in a single-server, non-failover environment, however we would like some sort of solution for sharing the files between servers that supports failover.
Has anyone run into this in the past? And what kind of solutions were you able to develop? Obviously persisting to the database is one option, but we'd prefer to avoid that.
At a former job we had a cluster of web servers with an F5 load balancer in front of them. We had a very similar problem in that our applications allowed users to upload content which might include photo's and such. These were legacy applications and we did not want to edit them to use a database and a SAN solution was too expensive for our situation.
We ended up using a file replication service on the two clustered servers. This ran as a service on both machines using an account that had network access to paths on the opposite server. When a file was uploaded, this backend service sync'd the data in the file system folders making it available to be served from either web server.
Two of the products we reviewed were ViceVersa and PeerSync. I think we ended up using PeerSync.
In our scenario, we have a separate file server that both of our front end app servers write to, that way you either server has access to the same sets of files.
The best solution for this is usually to provide the shared area on some form of SAN, which will be accessible from all servers and contain failover.
This also has the benefit that you don't have to provide sticky load balancing, the upload can be handled by one server, and the edit by another.
A shared SAN with failover is a great solution with a great (high) cost. Are there any similar solutions with failover at a reasonable cost? Perhaps something like DRBD for windows?
The problem with a simple shared filesystem is the lack of redundancy (what if the fileserver goes down)?

Resources