473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

web service serve up files

Hi,

I need to implement a function, GetAllFiles, of a web
service that once called, returns all the files in a
folder to the caller. My question is: what is the best way
to implement this function? If it is just one file, I can
use FileSteam's OpenRead and return
a Byte array to the caller. But in my case I need to
transfer multiple files and I don't think calling the
function mutiple times in a loop is very efficient. What
do I do?

Thanks

Nov 21 '05 #1
4 1327
sounds like a homework problem.

So, in protocols like FTP, is there a "get all files?" No. because it
doesn't make much sense.

On the other hand, if a webservice returns information about each of the
files in a directory (like a listing: filename, size, date, etc) and the
client can call another webservice method to get any PARTICULAR file, then
the client can easily ask for the listing, get it, the turn around and ask
for each file.

For a real world system, this makes much more sense than the notion of "get
all files" returning multiple binary streams.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"feng" <an*******@discussions.microsoft.com> wrote in message
news:34****************************@phx.gbl...
Hi,

I need to implement a function, GetAllFiles, of a web
service that once called, returns all the files in a
folder to the caller. My question is: what is the best way
to implement this function? If it is just one file, I can
use FileSteam's OpenRead and return
a Byte array to the caller. But in my case I need to
transfer multiple files and I don't think calling the
function mutiple times in a loop is very efficient. What
do I do?

Thanks

Nov 21 '05 #2
Thanks Nick!

Thank you for your input. I think I should have asked my
question a little clearer. Actually, I am developing a
deployment mechenisam for a Windows form application. The
web server acts as an deploy server and its only job, once
called, is to return all the exes and dlls to the client.
The client, as a matter of fact, already know all the info
about the files contained on the server's deploy
directory. It doesn't need the server to tell it anything
about the file properties. The only thing it needs from
the server is to GetAllFiles from the deploy directory.

Now, if this sounds making a little more sense, I would
like to come back to my orrigional question: How do I
implement the operation of returning muliple files from
the server? I don't want to make one server call for each
file. That would be too inefficient.

Any idea?

Thanks again!
-----Original Message-----
sounds like a homework problem.

So, in protocols like FTP, is there a "get all files?" No. because itdoesn't make much sense.

On the other hand, if a webservice returns information about each of thefiles in a directory (like a listing: filename, size, date, etc) and theclient can call another webservice method to get any PARTICULAR file, thenthe client can easily ask for the listing, get it, the turn around and askfor each file.

For a real world system, this makes much more sense than the notion of "getall files" returning multiple binary streams.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and notrepresentative of my employer.
I do not answer questions on behalf of my employer. I'm just aprogrammer helping programmers.
--
"feng" <an*******@discussions.microsoft.com> wrote in messagenews:34****************************@phx.gbl...
Hi,

I need to implement a function, GetAllFiles, of a web
service that once called, returns all the files in a
folder to the caller. My question is: what is the best way to implement this function? If it is just one file, I can use FileSteam's OpenRead and return
a Byte array to the caller. But in my case I need to
transfer multiple files and I don't think calling the
function mutiple times in a loop is very efficient. What
do I do?

Thanks

.

Nov 21 '05 #3
zip all files into one file?

"feng" <an*******@discussions.microsoft.com> escribió en el mensaje
news:51****************************@phx.gbl...
Thanks Nick!

Thank you for your input. I think I should have asked my
question a little clearer. Actually, I am developing a
deployment mechenisam for a Windows form application. The
web server acts as an deploy server and its only job, once
called, is to return all the exes and dlls to the client.
The client, as a matter of fact, already know all the info
about the files contained on the server's deploy
directory. It doesn't need the server to tell it anything
about the file properties. The only thing it needs from
the server is to GetAllFiles from the deploy directory.

Now, if this sounds making a little more sense, I would
like to come back to my orrigional question: How do I
implement the operation of returning muliple files from
the server? I don't want to make one server call for each
file. That would be too inefficient.

Any idea?

Thanks again!
-----Original Message-----
sounds like a homework problem.

So, in protocols like FTP, is there a "get all files?" No. because itdoesn't make much sense.

On the other hand, if a webservice returns information about each of thefiles in a directory (like a listing: filename, size, date, etc) and theclient can call another webservice method to get any PARTICULAR file, thenthe client can easily ask for the listing, get it, the turn around and askfor each file.

For a real world system, this makes much more sense than the notion of "getall files" returning multiple binary streams.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and notrepresentative of my employer.
I do not answer questions on behalf of my employer. I'm just aprogrammer helping programmers.
--
"feng" <an*******@discussions.microsoft.com> wrote in messagenews:34****************************@phx.gbl...
Hi,

I need to implement a function, GetAllFiles, of a web
service that once called, returns all the files in a
folder to the caller. My question is: what is the best way to implement this function? If it is just one file, I can use FileSteam's OpenRead and return
a Byte array to the caller. But in my case I need to
transfer multiple files and I don't think calling the
function mutiple times in a loop is very efficient. What
do I do?

Thanks

.

Nov 21 '05 #4
To answer your question: One format that can represent multiple files is
MIME. You can essentially make each file an attachment in a MIME message,
embed the MIME message into a SOAP response, and return that response after
your call.

I disagree that multiple calls is inefficient in some way. However, I hope
the info helps.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"feng" <an*******@discussions.microsoft.com> wrote in message
news:51****************************@phx.gbl...
Thanks Nick!

Thank you for your input. I think I should have asked my
question a little clearer. Actually, I am developing a
deployment mechenisam for a Windows form application. The
web server acts as an deploy server and its only job, once
called, is to return all the exes and dlls to the client.
The client, as a matter of fact, already know all the info
about the files contained on the server's deploy
directory. It doesn't need the server to tell it anything
about the file properties. The only thing it needs from
the server is to GetAllFiles from the deploy directory.

Now, if this sounds making a little more sense, I would
like to come back to my orrigional question: How do I
implement the operation of returning muliple files from
the server? I don't want to make one server call for each
file. That would be too inefficient.

Any idea?

Thanks again!
-----Original Message-----
sounds like a homework problem.

So, in protocols like FTP, is there a "get all files?"

No. because it
doesn't make much sense.

On the other hand, if a webservice returns information

about each of the
files in a directory (like a listing: filename, size,

date, etc) and the
client can call another webservice method to get any

PARTICULAR file, then
the client can easily ask for the listing, get it, the

turn around and ask
for each file.

For a real world system, this makes much more sense than

the notion of "get
all files" returning multiple binary streams.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own,

and not
representative of my employer.
I do not answer questions on behalf of my employer.

I'm just a
programmer helping programmers.
--
"feng" <an*******@discussions.microsoft.com> wrote in

message
news:34****************************@phx.gbl...
Hi,

I need to implement a function, GetAllFiles, of a web
service that once called, returns all the files in a
folder to the caller. My question is: what is the best way to implement this function? If it is just one file, I can use FileSteam's OpenRead and return
a Byte array to the caller. But in my case I need to
transfer multiple files and I don't think calling the
function mutiple times in a loop is very efficient. What
do I do?

Thanks

.

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Mark J. McGinty | last post by:
Greets, One site I've written allows the user to install an IE extension menu (not malware at all) by downloading/merging a short .REG file. Worked like a peach on Win2K Server, now that I...
21
by: Hattuari | last post by:
I'm learning C++ after having spent several years in the computer industry doing both system administration and engineering. I've written code in Perl, Bash, Pascal, Ada, C, Mathematica (hundreds...
2
by: Jim Adams | last post by:
My project requires IIS (dotNet) and Apache to consume the same web service. What's the recommended way to display the same HTML output from both platforms? I've read about server-side XSLT...
3
by: Neil Zanella | last post by:
Hello, I wonder whether anyone knows of any service providers which issue shell access for file upload (as in Unix ssh service), and at the same time allow users to serve ASP.NET files (via...
17
by: Jeremy Chapman | last post by:
I've seen apps where if a windows exe form is running, it publishes a web service. There is no IIS folders or virtual directories required. Does anyone have information on how to do this?
5
by: Gardar | last post by:
I have a .net webservice, developed with c++ managed extensions. The websrvice returns an xml-document with a reference to a server side xml-stylesheet in the format <?xml-stylesheet href =...
5
by: marccruz | last post by:
Hi, I am writing a Windows Service in C#. I want to gracefully fail the "protected override void OnStop()" function. To do this, I first tried throwing an Exception in the function. However,...
4
by: Alice | last post by:
How can I make php script serve up an *.html file 'server-parsed' for SSI's? The goal is to pre-process all *.html files with php script, but the SSI's need to be handled too. Problem with...
6
by: half.italian | last post by:
Hi, I'm trying to serve up a simple XMLRPC server as a windows service. I got it to run properly, I'm just not sure how to stop it properly. Most of the documentation/examples I found for this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.