sending an exe over a webservice

I currently have a .Net dll that calls a web service and is passed back a string.   Both are working fine.  I would like to change the web service to pass back an exe file instead..  

How do I pass back an exe from a web service?

Thanks,

Paul
waggertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
What is the big picture here?  Why would you want to use a web service for this?

Bob
0
waggertAuthor Commented:
There are remote machines around the country that have specific versions of sql db's.  There's a local process that when kicked off it checks to see if there's a later version of the db available.  If so, they hit a web service providing their current version as an int parameter.  The web service then constructs a custom .net executable that will update the client's db according to whatever version they are currently on.

So, there are almost an endless number of possible version to version update exe's because the local process is kicked off by the user and thus random.. Ex. 1 to 2, 1 to 3, 2 to 40, whatever.. so those exe's need to be created on demand, programmatically, based on the client's needs.

Currently, the web service is set up to return a custom sql string to update the client's db.  However, I just realized that I could have a .net exe do the same thing which would be much cleaner and eliminate a lot of code.  The problem now is just figuring out how to return an exe to the client via web service..

Thanks,

Paul
0
Timbo87Commented:
You can send it as a byte array.

Imports System.IO

Dim path As String = "c:\path\to\file.exe"
Dim fs As New FileStream(path, FileMode.Open)
Dim br As New BinaryReader(fs)
Dim bytes(fs.Length) As Byte

bytes = br.ReadBytes(fs.Length)

br.Close()
fs.Close()

At this point you would need to use a BinaryWriter to write the byte array back into a file.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

waggertAuthor Commented:
k, thanks Timbo, I will try that.

Paul
0
Bob LearnedCommented:
0
waggertAuthor Commented:
Thanks Timbo, works like a dream.. I had no idea it would be that easy.. .Net is awesome..

Thanks TLO, for your help as well.. Although the Smart Client updates won't work for this specific project I will most likely use them for others.. One more reason .Net is great.. :-)

Thanks!

Paul
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.