在我在WCF SharePoint应用中增加MaxReceiveMessage时,获得413个有效载荷太大。

发布于 2025-01-24 18:54:18 字数 2825 浏览 3 评论 0原文

我在SharePoint 2016上开发了WCF WebService在前提环境中。

当我尝试上传长身时,我曾经得到一个413有效载荷太大错误,所以我更改了我的app.config:

    <?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="ilem.Sharepoint.WebServices.ISAPI.ilemGroupWS.Service">
                <endpoint address="" binding="basicHttpBinding" contract="ilem.Sharepoint.WebServices.ISAPI.ilemGroupmWS.IService">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:8733/Design_Time_Addresses/ilem.Sharepoint.WebServices.ISAPI.ilemGroup/Service/" />
                    </baseAddresses>
                </host>
            </service>
        </services>
      <standardEndpoints>
        <webHttpEndpoint>
          <standardEndpoint name=""
               helpEnabled="true"
               automaticFormatSelectionEnabled="true"
               maxReceivedMessageSize="2147000000"
                 />
        </webHttpEndpoint>
      </standardEndpoints>
      <bindings>
        <basicHttpBinding>
          <binding name="MyBinding" maxBufferPoolSize="2000000000"
      maxBufferSize="2000000000" maxReceivedMessageSize="2000000000">
            <readerQuotas maxDepth="32"
                             maxArrayLength="200000000"
                             maxStringContentLength="200000000"/>
          </binding>
        </basicHttpBinding>
        <basicHttpsBinding>
          <binding name="MyBinding" maxBufferPoolSize="2000000000"
      maxBufferSize="2000000000" maxReceivedMessageSize="2000000000">
            <readerQuotas maxDepth="32"
                             maxArrayLength="200000000"
                             maxStringContentLength="200000000"/>
          </binding>
        </basicHttpsBinding>
      </bindings>
    </system.serviceModel>
</configuration>

但是现在我遇到了此错误:500(system.servicemodel.serviceactivativation exception)

是否有任何方法可以解决此问题问题?

I developed a wcf webservice in a sharepoint 2016 on premise environment.

When I try to upload a long body I used to get a 413 payload too large error so I changed my app.config to this:

    <?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="ilem.Sharepoint.WebServices.ISAPI.ilemGroupWS.Service">
                <endpoint address="" binding="basicHttpBinding" contract="ilem.Sharepoint.WebServices.ISAPI.ilemGroupmWS.IService">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:8733/Design_Time_Addresses/ilem.Sharepoint.WebServices.ISAPI.ilemGroup/Service/" />
                    </baseAddresses>
                </host>
            </service>
        </services>
      <standardEndpoints>
        <webHttpEndpoint>
          <standardEndpoint name=""
               helpEnabled="true"
               automaticFormatSelectionEnabled="true"
               maxReceivedMessageSize="2147000000"
                 />
        </webHttpEndpoint>
      </standardEndpoints>
      <bindings>
        <basicHttpBinding>
          <binding name="MyBinding" maxBufferPoolSize="2000000000"
      maxBufferSize="2000000000" maxReceivedMessageSize="2000000000">
            <readerQuotas maxDepth="32"
                             maxArrayLength="200000000"
                             maxStringContentLength="200000000"/>
          </binding>
        </basicHttpBinding>
        <basicHttpsBinding>
          <binding name="MyBinding" maxBufferPoolSize="2000000000"
      maxBufferSize="2000000000" maxReceivedMessageSize="2000000000">
            <readerQuotas maxDepth="32"
                             maxArrayLength="200000000"
                             maxStringContentLength="200000000"/>
          </binding>
        </basicHttpsBinding>
      </bindings>
    </system.serviceModel>
</configuration>

But now I get this error: 500 (System.ServiceModel.ServiceActivationException)

Is there any way to resolve this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

有深☉意 2025-01-31 18:54:18

我发现candy ConfigurationbindingConfiguration&lt; security Mode =“ transport”&gt;未在代码中设置,请确保配置配置他们。

您可以尝试设置incodeexectiondetailinfaults to true 配置跟踪 获取错误详细信息。

I found that behaviorConfiguration, bindingConfiguration, <security mode="Transport"> are not set in your code, please make sure to configure them.

You can try setting includeExceptionDetailInFaults to true or configuring tracing to get error details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文