I'm working on a WCF file uploader using WSHttpBinding. I am looking to upload files around 10 mb (not playing an exact game on that one, but won't be getting files much larger). Everything works pretty well up to about 5mb. after that, I start getting HTTP
500 errors.
Thanks for the help. The biggest problem I've found when trying to google stuff is that most of the answers require changing to WebHttpBinding, which is not my primary choice for making this work, although I'm starting to think it may be the only way.
HTTP error 500 illustrates that the server encountered an unexpected condition which prevented it from fulfilling the request, you could enable WCF tracing on the server side to see the inner executed information, maybe you can find some indicates.
Yup. WCF tracing helped. Turns out that the increase in size by the base-64 file transform pushed even 5mb files way over the limit. Peter gets the points.
Now.... For bonus points, what can I do to keep from performing that transform to keep bandwidth and buffer size low?
boehmap
Member
38 Points
36 Posts
Large file uploads via WSHttpBinding in WCF
May 02, 2012 02:21 PM|LINK
Hey everyone,
I'm working on a WCF file uploader using WSHttpBinding. I am looking to upload files around 10 mb (not playing an exact game on that one, but won't be getting files much larger). Everything works pretty well up to about 5mb. after that, I start getting HTTP 500 errors.
My binding is set up as follows:
My httpRuntime maxRequestLength is 20480kb in
My requests look like:
POST http://mywebsite/FileUploader.svc HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: application/soap+xml;charset=UTF-8;action="http://namespace/UploadPhoto" Content-Length: 13979476 Host: mywebsite Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:fil="http://namespace"> <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://namespace/IFileUploaderSvc/UploadPhoto</wsa:Action></soap:Header> <soap:Body> <fil:UploadPhoto> <fil:AuthorizationToken>(Password)</fil:AuthorizationToken> <fil:ProgramName>AProgram</fil:ProgramName> <fil:FileName>bigolefile.jpg</fil:FileName> <fil:File>(base 64 file data)</fil:File> </fil:UploadPhoto> </soap:Body> </soap:Envelope>Anyone have any ideas?
Thanks in advance!
"Just make it work"
rio.jones
Member
246 Points
53 Posts
Re: Large file uploads via WSHttpBinding in WCF
May 02, 2012 02:27 PM|LINK
check this link this may help you out
http://stackoverflow.com/questions/6911817/wcf-upload-large-images-as-wshttpbinding
boehmap
Member
38 Points
36 Posts
Re: Large file uploads via WSHttpBinding in WCF
May 02, 2012 02:36 PM|LINK
Thanks for the help. The biggest problem I've found when trying to google stuff is that most of the answers require changing to WebHttpBinding, which is not my primary choice for making this work, although I'm starting to think it may be the only way.
Anyone else have any ideas?
"Just make it work"
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Large file uploads via WSHttpBinding in WCF
May 04, 2012 06:16 AM|LINK
HTTP error 500 illustrates that the server encountered an unexpected condition which prevented it from fulfilling the request, you could enable WCF tracing on the server side to see the inner executed information, maybe you can find some indicates.
#Enable WCF tracing.
http://blogs.msdn.com/b/madhuponduru/archive/2006/05/18/601458.aspx
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
boehmap
Member
38 Points
36 Posts
Re: Large file uploads via WSHttpBinding in WCF
May 04, 2012 01:47 PM|LINK
Yup. WCF tracing helped. Turns out that the increase in size by the base-64 file transform pushed even 5mb files way over the limit. Peter gets the points.
Now.... For bonus points, what can I do to keep from performing that transform to keep bandwidth and buffer size low?
"Just make it work"