Error 400 (bad request): maxReceivedMessageSize not taken into account for my WCF service

自作多情 提交于 2019-12-01 01:06:22

Everything seems to be fine at first glance - only point is: the <service name="....."> attribute must match exactly to your fully-qualified service implementation class (including all namespaces etc.) - is that the case??

I ask because you have contract="XXX.IMyContract" indicating a namespace, but your <service name="...."> attribute doesn't have any namespace hinted at.

Try by the following web-config settings in service :

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
      multipleSiteBindingsEnabled="true" />
    <standardEndpoints>

            <webHttpEndpoint>
                <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"                                        
                                  crossDomainScriptAccessEnabled="true" 
                                  maxReceivedMessageSize="2147483647" 
                                  maxBufferSize="2147483647" 
                                  maxBufferPoolSize="4194304" />
            </webHttpEndpoint>

    </standardEndpoints>

    <bindings>
        <webHttpBinding>
            <binding>
                <readerQuotas maxStringContentLength="2147483647"/>
            </binding>
        </webHttpBinding>
    </bindings>

</system.serviceModel>

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!