我有一个MVC5Web应用程序,在其中我有一个WCF服务,其中包含以下合同:
[ServiceContract(ConfigurationName="IDocumentGenerator")]
public interface IDocumentGenerator
{
[OperationContract(Action = "GenerateDocument"), XmlSerializerFormat]
Stream GenerateDocument(string DocId, string Format, string returnAs, string userName, string password, XmlDocument Payload);
}我在Web.Config文件中使用了以下配置:
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" transferMode="Streamed">
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:64172/DocumentGenerator.svc" binding="webHttpBinding" contract="IDocumentGenerator" name="WebHttpBinding_IDocumentGenerator" />
</client>
</system.serviceModel>接下来,我使用Apache向URL http://localhost:64172/DocumentGenerator.svc发送一个Soap-XML/RPC Request,所有小于65KB的请求都会命中IIS Express Server,但一旦请求变得更大,请求甚至不会命中服务器。
我已经尝试了4-5个小时的不同选项,但无法解决。
任何帮助都是非常感谢的。
发布于 2016-08-30 13:45:58
发布于 2016-08-30 14:29:26
在您的binding标记中添加以下内容
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />你的绑定标签会喜欢这样的
<binding
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" transferMode="Streamed">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>https://stackoverflow.com/questions/39219279
复制相似问题