Reputation: 840
This is getting Frustrating ... I am semi-new to web services, and I dont really understand why I can't figure out how to use Microsoft WSE 3.0 to enable MTOM encoding for SOAP on my web service. I have added the following to my web service:
Web.config and app.config in my library on the server:
<configuration>
<configSections>
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>
<system.web>
<httpRuntime maxRequestLength="134217728" executionTimeout="300"/>
<webServices>
<soapExtensionImporterTypes>
<add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</soapExtensionImporterTypes>
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</webServices>
<compilation>
<assemblies>
<add assembly="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
<microsoft.web.services3>
<messaging>
<mtom serverMode="always" />
<maxMessageLength value="134217728" />
</messaging>
</microsoft.web.services3>
</configuration>
On the client side I added the same to the app.config, adding did clientMode="On".
When I try to upload a 40MB file, I get the popular error "Maximum request length exceeded."
Any explanation? Do I have to tell the transports to use that configuration? How do I do that? Thanks!
Upvotes: 0
Views: 1747
Reputation: 3970
You might be running up against the maxAllowedContentLength of the Web Server. If you are running IIS7, try adding this code block to your web.config. IIS7 filters the request before the http runtime gets it.
http://msdn.microsoft.com/en-us/library/ie/ms689462(v=vs.90).aspx
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="134217728" />
</requestFiltering>
</security>
</system.webServer>
Upvotes: 2