我有 WCF 服务,我正在发送以下数据合同
[DataContract]
public class Sample
{
[DataMember]
public int Type { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Value { get; set; }
[DataMember]
public byte[] ByteList { get; set; }
}
但是随着字节数组大小的增加,客户端不接受数据。他们成功接收到其他消息。我尝试增加.config 中的大小。我还尝试在使用 DataContractSerializer 序列化后发送对象,但对我没有任何作用。我知道这是我这边的一些错误,但我无法弄清楚。请让我知道你的意见
<netTcpBinding>
<binding name="tcpbinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="2147483646" maxConnections="10"
maxReceivedMessageSize="2147483646">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="true" />
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
<message clientCredentialType="Windows"/>
</security>
</binding>
</netTcpBinding>