Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sending an exe over a webservice

Posted on 2004-10-29
6
Medium Priority
?
166 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:waggert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 96

Expert Comment

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

Bob
0
 

Author Comment

by:waggert
ID: 12447181
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
 
LVL 15

Accepted Solution

by:
Timbo87 earned 1200 total points
ID: 12448454
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:waggert
ID: 12448490
k, thanks Timbo, I will try that.

Paul
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12452078
0
 

Author Comment

by:waggert
ID: 12458354
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

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question