468,791 Members | 1,702 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,791 developers. It's quick & easy.

Transport large binary file from Window client application to Web Server & back

Hi All
I need some help for the below problem:

Scenario

We need to send large binary files (audio file of about 10 MB or so)
from the client machine (.Net Windows based application, located
outside the home network) to the Web Server and then retrieve the file
back from the web server to the client.

Possible Solutions

1. Sending the entire file using https

2. Sending the file using XOP (XML binary optimized packaging), but the
limitation with this approach is that the actual binary data is stored
in XOP package which is stored on a external Web Server and the XOP
(XML) document just contains a reference of the actual binary file.

3. Sending the file using SFTP( limitation client as some issues
regarding storing password information for SFTP and is not the
preferred option)

4. Using DIME - Sending Binary Data with SOAP Messages

5. Using WS-Attachments

6. Using https - not sure if large files can be handled efficiently

In a normal scenario, the binary file can be converted into XML by
using binary64 encoding. But due to large nature of the size of the
file, there may be performance issues.

I will appreciate if you can provide me some useful inputs on how to
resolve the above problem either through any of the above mentioned
solutions or some new possibility which I have not explored yet.

Regards

Gaurav

Nov 23 '05 #1
2 4241
http://msdn.microsoft.com/webservice...ml/newwse3.asp

MTOM, otherwise known as Message Transmission Optimization Mechanism,
enables you to send binary data efficiently as part of a SOAP message. The
key word here is optimization, since to all intents and purpose this is
transparent to the developer and simply just happens when enabled. MTOM is a
W3C recommendation that replaces DIME and WS-Attachments as the mechanism
for sending large amounts of data such as document files and images.
<ga**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
We need to send large binary files (audio file of about 10 MB or so)
from the client machine (.Net Windows based application, located
outside the home network) to the Web Server and then retrieve the file
back from the web server to the client.

Nov 23 '05 #2
Hi,
Its quite easy to send large files as DIME attachments with WSE2. I use
#ziplib to zip the files i send if they are above a certain size (but i guess
if they are mp3s/compressed this wouldnt be needed)

easy as

using(MyWebService.TransferServicesWse service = new
MyWebService.TransferServicesWse())
{
DimeAttachment attachment = new DimeAttachment("a_music_file,
"audio/compressed", TypeFormat.None, "c:\music\a.mp3");
service.RequestSoapContext.Attachments.Add(attachm ent);
service.UploadFiles();
}
and in the webservice

for (int index = 0; index < requestContext.Attachments.Count; index++)
{
string fileName = requestContext.Attachments[index].Id;

using(Stream stream = requestContext.Attachments[index].Stream)
{
switch(requestContext.Attachments[index].ContentType)
{
case "audio/compressed":
{
//if its big take it in chunks (im too lazy to put it in this example)
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
using(FileStream fstream = File.Create(@"c:\temp\" + fileName,
buffer.Length))
{
fstream.Write(buffer, 0, buffer.Length);
fstream.Close();
}
break;
}

}

stream.Close();
}
}

hope that helps you :)

Scott

"ga**********@gmail.com" wrote:
Hi All
I need some help for the below problem:

Scenario

We need to send large binary files (audio file of about 10 MB or so)
from the client machine (.Net Windows based application, located
outside the home network) to the Web Server and then retrieve the file
back from the web server to the client.

Possible Solutions

1. Sending the entire file using https

2. Sending the file using XOP (XML binary optimized packaging), but the
limitation with this approach is that the actual binary data is stored
in XOP package which is stored on a external Web Server and the XOP
(XML) document just contains a reference of the actual binary file.

3. Sending the file using SFTP( limitation client as some issues
regarding storing password information for SFTP and is not the
preferred option)

4. Using DIME - Sending Binary Data with SOAP Messages

5. Using WS-Attachments

6. Using https - not sure if large files can be handled efficiently

In a normal scenario, the binary file can be converted into XML by
using binary64 encoding. But due to large nature of the size of the
file, there may be performance issues.

I will appreciate if you can provide me some useful inputs on how to
resolve the above problem either through any of the above mentioned
solutions or some new possibility which I have not explored yet.

Regards

Gaurav

Nov 25 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Russ Reynolds | last post: by
2 posts views Thread by Lisa Pearlson | last post: by
11 posts views Thread by CSN | last post: by
1 post views Thread by google | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.