【发布时间】:2022-03-18 11:02:10
【问题描述】:
我的系统:
IIS 7.5
Visual Studio 2010
框架 4
我已经创建了一个接收文件(字节数组)的 Web 服务。 我制作了一个使用它的控制台应用程序(添加服务引用--> 高级--> 添加 Web 引用)。使用http它可以完美运行。但我需要用 https 来消费它。因此,当我尝试使用 https 使用它时,它给了我 HTTP 413:请求实体太大。我已经阅读了很多,但这是不可能的。我已尝试将 Web Service 的 webconfig 放入:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_INopService" maxReceivedMessageSize="22147483647" maxBufferPoolSize="252428800" maxBufferSize="22147483647">
<readerQuotas maxDepth="256" maxStringContentLength="22147483647" maxArrayLength="2222216384"
maxBytesPerRead="2222220000" maxNameTableCharCount="2222216384" ></readerQuotas>
</binding>
</basicHttpBinding>
<basicHttpBinding>
<binding name="HttpBigMessage"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
maxReceivedMessageSize="2147483647" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://localhost/hmenu/GetData.asmx"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_INopService"
contract="PhotoSavingsService.INopService" name="BasicHttpBinding_INopService" />
</client>
</system.serviceModel>
文件不是太大。 我需要把最大尺寸放在哪里?
谢谢
【问题讨论】:
-
没办法。我制作了一个只返回 true 的虚拟方法,并且它正在发生同样的情况......
-
是的!有了最后一个链接,一切都很好!谢谢!
标签: c# web-services console-application http-status-code-413