Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass arguments to service?

Status
Not open for further replies.

lidds

Programmer
Jun 9, 2005
72
GB
I need a bit of help and guidance on an app I am doing....

I have an application which sits on general users machines. What I want to be able to do is for the users to create a new directory through the application that will create a directory on a server that they do not have access to for secutiry reasons. Then the users can create a file within the new folder through the application, again which they do not have access to. The whole idea is to have an application that manages files that are able to be accessed by many users through the application / backend database, and therefore we do not want the user to be able to manipluate the folder / files by mapping to the location. Then if the user wants to work on the file he requests it through the application which then copies it locally to their machine.

The way that I can see this working is by having a service running on the server that has access to create folders and files in this location. The user can then request the creation of a folder / file through the application which then instructs the service to create the folder / file.

My questions are:
1. Is this a good way?
2. Is there anyway that I can pass arguments directly into the service on the server, or would I have to create an entry in a database on the server that the service is monitoring and then performs the request?
2a. If I do have to have the service monitoring the database if I make the service check this every second will this slow the server down and will the server guys at a company be OK with this running this quick?
3. I also need to be able to let the user know through my application that the folder / file has been created successfully, therefore what is the best way to do this? Again get the service to write to the database that the request has been completed?
3a. If this is the case then my app will have to poll the database continually to check the database that the request has been completed, this could slow the application down?

As you can see I really need some guidance on how to acheive this. Any help would be really apreshiated

Thanks

Simon
 
Interesting question and approach. One key benefit of what you are trying to do is that the service runs under it's own account permissions, so might be able to access folders that your users cant normally access.

Latency is one key issue you need to address. How often and quickly does the service need to respond. Is every second too frequent. is 5 minutes too slow.

Also need to decide how your front end talks to the service. Placing records in a database might be overkill. There could be several other approaches. Reserve a TCP/IP socket and use that, or maybe MSMQ or some other remoting of objects. Another app I know writes requests into a file that the service can see. If your app is a web service it might respond in a better way.

But in the end, decide why you are doing this. All seems a little complicated to me. Always better to keep things simple.

Editor and Publisher of Crystal Clear
 
In order to pass requests across the network to this service, you'll have to use one of the usual network-aware protocols & APIs.

TCP/IP sockets
MSMQ
Remoting
WCF
Web Service
Or even email. :)

Chip H.



____________________________________________________________________
www.chipholland.com
 
I wrote a Windows service last year which sits on a server wherein the client application makes a TCP/IP connection to the service to request the server to perform tasks. It works really well. So I think the suggestions mentioned above are definitely worth considering.

However, I'm not sure the folder approach is the best approach for you. If the user will have no access to the remote file system, why not just store all files within one directory, and make an entry into a database as far as who owns the file, or what category it belongs to? This way, you get the benefit of the user seeing how the files are organized (think of it as a virtual directory tree) but you don't end up with a bunch of sub directories. You can even store the original file name in the database, but use a system generated name to store the actual file in the file system.
 
Personally I don't have a use for it right now, but I really like your idea RiverGuy.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top