471,319 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 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 1247
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Mark J. McGinty | last post: by
21 posts views Thread by Hattuari | last post: by
2 posts views Thread by Jim Adams | last post: by
3 posts views Thread by Neil Zanella | last post: by
17 posts views Thread by Jeremy Chapman | last post: by
5 posts views Thread by Gardar | last post: by
4 posts views Thread by Alice | last post: by
6 posts views Thread by half.italian | last post: by

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.