这越来越令人沮丧......我对 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 中添加了相同的内容,添加了客户端模式="On"。
当我尝试上传一个 40MB 的文件时,我收到了常见的错误“超出了最大请求长度”。
有什么解释吗?我是否必须告诉传输使用该配置?我怎么做?谢谢!