What are the acceptable data types for a service?

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
How many different kinds of data can a VB.NET windows service accept? I have written those that accept simple things like int and string and double. And I have one that accepts a dataset.

But what are some other types?
What if I want to pass a whole file, like a small text file or csv?
 
I believe you can, I dont know what you mean by accept, but I have accessed and parsed several files (text,xml, etc ..) using a windows service.
 
Okay cool.

So you have a text file, say text.txt, and you want to send it across time and space to a web service. How do you go about that?

<Web Method>_ Public Function GetFile as File
 
Easiest way is read it into either a string or a byte array depending on it's contents and return that to the client.
Saving the file to disk (or whatever else) is then the clients problem.
 
You cannot return Files through a web service

You can do as PlausiblyDamp told you if you are talking about small files, but I think if you are planning to transfer huge files then you are better of with downloading or uploading files (FTP for example might do you good), However , to use FTP you will have to use third party utilities. It is not directly supported in .NET


Hope this helps...
 
Back
Top