0

これはイライラします...私はWebサービスに半ば慣れていませんが、MicrosoftWSE3.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のファイルをアップロードしようとすると、「最大リクエスト長を超えました」というよくあるエラーが表示されます。

説明はありますか?その構成を使用するようにトランスポートに指示する必要がありますか?それ、どうやったら出来るの?ありがとう!

4

1 に答える 1

2

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>
于 2012-01-24T17:51:01.563 に答える