पार हो गई है जब मैं एक WCF सेवा को कॉल मैं एक अपवाद प्राप्त करें:WCF अपवाद: भेजे गए संदेशों के लिए अधिकतम संदेश आकार कोटा (65536)
अधिकतम भेजे गए संदेशों के लिए संदेश आकार कोटा (65536) कर दिया गया है पार हो गई। कोटा बढ़ाने के लिए, उचित बाध्यकारी तत्व पर MaxReceivedMessageSize गुण का उपयोग करें।
जब मैं http पर वायरसहार्क पैकेट विश्लेषक फ़िल्टर का उपयोग करता हूं तो भेजे गए बड़े पैमाने पर पैकेट 1226 बाइट्स है, जिस तरह से 65536 बाइट की सीमा है। इस अपवाद को क्यों फेंक दिया गया है इसके लिए कोई सुझाव?
Protocole-लंबाई-जानकारी
सर्वर स्टैक ट्रेस:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
...
<binding
name="WSHttpBinding_IService"
closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas
maxDepth="32"
maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession
ordered="true"
inactivityTimeout="00:10:00"
enabled="false" />
<security
mode="Message">
<transport
clientCredentialType="Windows"
proxyCredentialType="None"
realm="" />
<message
clientCredentialType="Certificate"
negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
कोड है कि मैं संदेह अपवाद का कारण बनता है:
public LoanPlan CalculateLoanPlans(string productName)
{
var loanPlan = new LoanPlan
{
Details = new[]
{
new PlanDetails {LoanAmount = 5000, Periods = 6},
new PlanDetails {LoanAmount = 5000, Periods = 12},
new PlanDetails {LoanAmount = 5000, Periods = 24},
new PlanDetails {LoanAmount = 10000, Periods = 6},
new PlanDetails {LoanAmount = 10000, Periods = 12},
new PlanDetails {LoanAmount = 10000, Periods = 24},
new PlanDetails {LoanAmount = 15000, Periods = 6},
new PlanDetails {LoanAmount = 15000, Periods = 12},
new PlanDetails {LoanAmount = 15000, Periods = 24},
new PlanDetails {LoanAmount = 20000, Periods = 6},
new PlanDetails {LoanAmount = 20000, Periods = 12},
new PlanDetails {LoanAmount = 20000, Periods = 24},
new PlanDetails {LoanAmount = 30000, Periods = 6},
new PlanDetails {LoanAmount = 30000, Periods = 12},
new PlanDetails {LoanAmount = 30000, Periods = 24},
new PlanDetails {LoanAmount = 40000, Periods = 6},
new PlanDetails {LoanAmount = 40000, Periods = 12},
new PlanDetails {LoanAmount = 40000, Periods = 24},
new PlanDetails {LoanAmount = 50000, Periods = 6},
new PlanDetails {LoanAmount = 50000, Periods = 12},
new PlanDetails {LoanAmount = 50000, Periods = 24}
},
TaxProcent = _taxPercent,
};
Parallel.ForEach(loanPlan.Details, detail =>
{
var result = Calculate(productName, Convert.ToInt32(detail.LoanAmount), detail.Periods, null);
detail.ActualPaymentCost = result.ActualPaymentCost;
detail.CreditCost = result.CreditAmount;
detail.MonthlyPayment = result.MonthlyPayment;
detail.MonthlyPaymentCost = result.MonthlyPaymentCredit;
});
var firstDetail = loanPlan.Details[0];
var firstResult = Calculate(productName, Convert.ToInt32(firstDetail.LoanAmount), firstDetail.Periods, null);
loanPlan.MonthlyFee = firstResult.MonthlyFee;
loanPlan.MonthlyInterest = firstResult.MonthlyInterest;
return loanPlan;
}
गणना विधि servicecall शामिल हैं।
आप अपने config प्रविष्टियों पोस्ट कर सकते हैं? – Rajesh
कृपया क्लाइंट और सर्वर दोनों पर अपनी कॉन्फ़िगरेशन में अपने बाध्यकारी तत्व के भीतर निम्न पाठक क्वाट्स सेट करें: और आपके व्यवहार कॉन्फ़िगरेशन तत्व में डेटाकंट्रैक सीरिएलाइज़र: और अधिकतम रसीद मैसेज आकार को दिखाए गए अनुसार सेट करें: <बाध्यकारी नाम = "mybinding" maxReceivedMessageSize = "2147483647"> –
Rajesh
क्या त्रुटि सर्वर उत्तर से नहीं आती है आपके अनुरोध? – adrianm