当我发送太多xml文件时,我在WCF程序中收到以下错误:
System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (413) Request Entity Too Large. ---> System.Net.WebException: The remote server returned an error: (413) Request Entity Too Large.
所有其他堆栈溢出答案似乎都没有为我提供解决方案,因为他们在app.config中提到绑定元素,而我的app.config使用服务,所以我不确定在哪里坚持更改。这也让我想知道我是否也在为生产服务编写配置文件错误。
的app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="ConfigService.UserService">
<endpoint address="" binding="basicHttpBinding" contract="ConfigService.IUserService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/ProductionProgrammerWebService/UserService/" />
</baseAddresses>
<timeouts openTimeout="00:00:30" />
</host>
</service>
<service name="ConfigService.ConfigurationService">
<endpoint address="" binding="basicHttpBinding" contract="ConfigService.IConfigurationService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/ProductionProgrammerWebService/ConfigurationService/" />
</baseAddresses>
<timeouts openTimeout="00:00:30" />
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>