473,785 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1344
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*******@disc ussions.microso ft.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 notrepresentati ve of my employer.
I do not answer questions on behalf of my employer. I'm just aprogrammer helping programmers.
--
"feng" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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 notrepresentati ve of my employer.
I do not answer questions on behalf of my employer. I'm just aprogrammer helping programmers.
--
"feng" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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
representativ e of my employer.
I do not answer questions on behalf of my employer.

I'm just a
programmer helping programmers.
--
"feng" <an*******@disc ussions.microso ft.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
8776
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 upgraded to Server 2003, it returns a 404 file not found error. I'm positive the file is there/spelled right. I changed it to .txt and it displays the text in the user's browser. So there's little question that this is some "security" addition, to...
21
2620
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 of lines of OO code, not 1+1), JavaScript, Lisp, and Java, as well as C++. Each of these languages has it's strengths and weaknesses. My experience with C++ has shown me that it is by far the most difficult for me to learn. I have the sense...
2
1830
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 rendering HTML which seems to be common ground. Does anyone have experience with this (e.g. WYSIWYG page design)? Any other suggestions?
3
1798
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 mounting the Unix drive on a Windows Server with Samba and having such file configured as a virtual IIS directory). I would be interested in any service providers which offer such a service as I could have all the benefits of a Unix shell while...
17
5061
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
2033
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 = 'StyleSheet.xsl' type = 'text/xsl'?> This allows the client to retrieve the stylesheet for rendering the xml, if needed. When I test this with IE it detects the stylesheet reference and tries to get the stylesheet file with the following "GET"
5
6493
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, that left the Service in a "Stopping" state. I would like to fail the Service in the OnStop function without putting the service in the Stopping state. It would be nice if it's still in the Started state. Is this possible? If so, how?
4
2309
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 using 'virtual' is that it creates a loop via the .htaccess handler setting/action.
6
2499
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 was from forums, so I'd love some links to relevant info also. Here's what I have...taken from the cookbook with the xmlrpc server added: import win32serviceutil import win32service
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.