启用MTOM;超过了最大请求长度";还
本文关键字:quot 请求 MTOM 过了 启用 | 更新日期: 2023-09-27 18:21:21
这越来越令人沮丧。。。我对web服务还不太熟悉,我真的不明白为什么我不知道如何使用Microsoft WSE 3.0在我的web服务上为SOAP启用MTOM编码。我已将以下内容添加到我的web服务中:
服务器上我的库中的Web.config和app.config:
<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>
在客户端,我将其添加到app.config中,添加了did-clientMode="On"。
当我尝试上传一个40MB的文件时,我得到了一个流行的错误"超过了最大请求长度"
有什么解释吗?我必须告诉运输公司使用这种配置吗?我该怎么做?谢谢
您可能遇到了Web服务器的maxAllowedContentLength。如果您正在运行IIS7,请尝试将此代码块添加到web.config中。IIS7会在http运行时获取请求之前对其进行筛选。
http://msdn.microsoft.com/en-us/library/ie/ms689462(v=vs.90).aspx
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="134217728" />
</requestFiltering>
</security>
</system.webServer>