473,473 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MTOM vs HttpWebRequest for file upload

I've been looking at both MTOM and simple HTTP POST or PUT for file uploads.
Some relevant details:

... We want to support programmatic file uploads from Winform apps.
... The files are large binaries, large enough that we would need to increase
the maxRequestLength value.
... We don't need the other WS-* features that come with WSE.
... Currently a pure intranet environment. We may extend outside the
firewall in the mid-term future, but it's unclear if file uploads will be
part of that.

Given the above, what are the pros and cons of each approach?

Many thanks -
Oct 23 '06 #1
7 7492
Hello Russell,

As for the file uploading from your client winform application to the
server service, do you need to do additional authentication against the
client before upload or at each file uploading?

Regardless of any other requirement, from performance perspective, use HTTP
POST to upload file will be more efficient because the file content is
directly transfered as binary content in the http post request. While
using WSE MTOM, it still use some particular encoding schema to convert the
file content thus it will add some additional overhead. However, comparing
to directly transfer byte[] in webservice method, using MTOM will be much
more efficient.

You can consider which approach to use according to your scenario. If there
is any other questions on this, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Oct 24 '06 #2
Steven -

Many thanks for this reply, and for your follow-up to me.

We are authenticating the client to the service layer using integrated
Windows authentication. This is primarily for tracking who is doing what,
i.e., auditing, and less for security per se. We have other controls on who
can run the app itself, so the back end trusts the client to not permit
illegal uploads. If you can get to the service at all through the app, the
service assumes that you are a legitimate user.

The upload service, via its app pool identity, owns the permission to read
and write to the backing filesystem, the user does not.

As it turns out, I also overestimated the size of the files. They are
binary *.wav files ranging in size from the low K's to hundreds of K's of
bytes.

From your comments so far my intuition is that HTTP POST will be the better
choice. Does that seem correct?

Many thanks, again, for your comments, they were very helpful.

Best -

R

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:fY**************@TK2MSFTNGXA01.phx.gbl...
Hello Russell,

As for the file uploading from your client winform application to the
server service, do you need to do additional authentication against the
client before upload or at each file uploading?

Regardless of any other requirement, from performance perspective, use
HTTP
POST to upload file will be more efficient because the file content is
directly transfered as binary content in the http post request. While
using WSE MTOM, it still use some particular encoding schema to convert
the
file content thus it will add some additional overhead. However,
comparing
to directly transfer byte[] in webservice method, using MTOM will be much
more efficient.

You can consider which approach to use according to your scenario. If
there
is any other questions on this, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Oct 27 '06 #3
Thanks for your followup Russell,

Sure. I think use http post directly will be the best choice for you here
and you do not need to use webservice at all since it will add additional
XML serizalization overhead.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Oct 27 '06 #4
Hi,

I have a similar problem. Thank you for your response.

It seems that these approaches have the same problem - the entire content of
file needs to be loaded in memory on the client before transmitted, and the
entire content of the file needs to be loaded in memory on the server before
anything can be done with it.

Can you recommend an approach which allows streaming or chunking of the
upload? I have seen sample code that attempt to do this with web-methods and
the IXmlSerializable interface, but I can't make them work for upload.

I will post here if I have something working!

Thanx!

"Steven Cheng[MSFT]" wrote:
Thanks for your followup Russell,

Sure. I think use http post directly will be the best choice for you here
and you do not need to use webservice at all since it will add additional
XML serizalization overhead.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights
Oct 27 '06 #5
Hi Gw,

Thanks for the input.

Yes, you're right, both the two solutions will load the full binary content
into memory before send or receive since both HttpWebRequest or MTOM WSE
are encapsulated component which make use of the default behavior of HTTP.
For your scenario, if you want a streaming or chunkced solution, you may
need to consider use socket programming directly and handle the
client-server's network transfering.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Oct 30 '06 #6
One of the weakest points of MTOM (to me) is that it loads the entire file
into memory on the web server. This, in essence, makes it unusable for large
files, or over unstable connections.

I was trying to force MTOM to work with very large files (1GB+), and ended
up having to use an FTP type of solution instead. It seems strange to me
that, at the protocol level, they couldn't work around this by building in
chunking or having a standard procol on top of MTOM.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins

"russell.lane" <ru**********@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
I've been looking at both MTOM and simple HTTP POST or PUT for file
uploads. Some relevant details:

.. We want to support programmatic file uploads from Winform apps.
.. The files are large binaries, large enough that we would need to
increase the maxRequestLength value.
.. We don't need the other WS-* features that come with WSE.
.. Currently a pure intranet environment. We may extend outside the
firewall in the mid-term future, but it's unclear if file uploads will be
part of that.

Given the above, what are the pros and cons of each approach?

Many thanks -


Oct 31 '06 #7
Hello Steven,

is there any solution to bypass the main memory while sending data to a
server?
In my case i have to write a SharePoint client, which should be able to
upload data bypassing the RAM because there should be no file size limitation.
I'm not sure if I should go down to the socket layer, due to my lack of
experiance with the socket security behavior and about the security polices
on the server. Actually all I know about the server is that it is running
SharePoint.

Is there anyway to transmit data bypassing the RAM with the WebClient /
WebRequest classes?!

Thank You in advance!

I badly need a solution!
Many thanks,

Pavel

"Steven Cheng[MSFT]" wrote:
Hi Gw,

Thanks for the input.

Yes, you're right, both the two solutions will load the full binary content
into memory before send or receive since both HttpWebRequest or MTOM WSE
are encapsulated component which make use of the default behavior of HTTP.
For your scenario, if you want a streaming or chunkced solution, you may
need to consider use socket programming directly and handle the
client-server's network transfering.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights
Dec 4 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
4
by: supster | last post by:
Hello, I am trying to use HttpWebRequest to simulate sending some POST data from a form to a PHP script. I have accomplished this using: HttpWebRequest req = (HttpWebRequest)...
8
by: Du | last post by:
I'm trying to automate the upload process to yousendit.com, but the file size doesn't add up and yousendit.com keep rejecting my upload (it accepts the upload until the very end) I don't know...
0
by: Brett | last post by:
I'd like to upload a file in vb.net vis POST using HttpWebRequest. It needs to simulate some one using a webform. The webform works fine when I manually upload through the web browser. However,...
1
by: Ollie Riches | last post by:
Hi, I am recieving an exception when adding support for MTOM to a web config file that is using WSE3.0 to talk to a web service. when the following section is added: <messaging> <mtom...
1
by: Gert Conradie | last post by:
The following code can uplaod text files. When i upload a binary file it fail. I might be: 1) using the wrong Encoding 2) will have to System.Convert.ToBase64String the content of the binary...
7
by: Marc Bartsch | last post by:
Hi, I have a background worker in my C# app that makes a synchronous HttpWebRequest.GetResponse() call. The idea is to POST a file to a server on the internet. When I call HttpWebRequest.Abort()...
1
by: Proogeren | last post by:
I have a problem with a httpwebrequest that I am creating. The request in itself looks correct but using fiddler I see that a www-authentication header is sent along as well. The code is pasted...
5
by: kamlesh20J | last post by:
Hello, I am trying to use HttpWebRequest to send some POST data I have accomplished this using: HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://mysite.com/index.php");...
0
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...
0
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,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.