Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
My WCF service working fine when my dataset table contain less no rows...

When the DataSet tables contains large data then it gives error like this..

MSIL
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelFactory.OnClose(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelFactory.TypedServiceChannelFactory`1.OnClose(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.ChannelFactory.OnClose(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.ChannelFactory.System.IDisposable.Dispose()
at ECMS.UnitTests.TestCurriculumManagement.SyllabusReportRetrieval() in D:\objmap\src\tests\ECMS.ServiceTest\TestCurriculumManagement.cs:line 922



i configured to increase the size of serialization data in configuration file...as follows

XML
<bindings>
  <netTcpBinding>
    <binding name="ECMSBindingConfig" maxReceivedMessageSize="8192" maxBufferSize="8192" openTimeout="10:00:00" closeTimeout="10:00:00"  sendTimeout="10:00:00" maxBufferPoolSize="8192" ></binding>
  </netTcpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="ECMSServiceBehavior">
      <dataContractSerializer maxItemsInObjectGraph="5000"/>
      <serviceDebug includeExceptionDetailInFaults="True" />
      <serviceThrottling maxConcurrentCalls="200" maxConcurrentInstances="100" maxConcurrentSessions="100" />
    </behavior>
  </serviceBehaviors>
</behaviors>


and Service end point is

XML
<service name="ECMS.Curriculum.Impl.CurriculumManager" behaviorConfiguration="ECMSServiceBehavior">
   <endpoint address="net.tcp://localhost:6775/ECMS.Curriculum.Impl.CurriculumManager" binding="netTcpBinding" bindingConfiguration="ECMSBindingConfig" contract="ECMS.Curriculum.Interface.ICurriculumManagement" />
 </service>



in client side

XML
<bindings>
  <netTcpBinding>
    <binding name="ECMSBindingConfig" maxReceivedMessageSize="8192" closeTimeout="10:00:00" maxBufferSize="8192" receiveTimeout="10:00:00"  maxBufferPoolSize="8192" ></binding>
  </netTcpBinding>
</bindings>


can any one help me to solve this problem ...
Thanks in Adv
Posted

Increase the max buffer size and the max received message size. e.g

maxBufferSize="1000000" maxReceivedMessageSize="1000000"

A full binding may read

XML
<basicHttpBinding>
  <binding name="BasicHttpBinding_MyApplication" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="1000000" maxBufferPoolSize="524288" maxReceivedMessageSize="1000000"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <security mode="TransportCredentialOnly">
      <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
      <message clientCredentialType="UserName" algorithmSuite="Default" />
    </security>
  </binding>
</basicHttpBinding>
 
Share this answer
 
Comments
Rajesh Kumar Chekuri 21-Mar-11 7:10am    
where this i need to set i mean in WCF or in Clinet..
Dylan Morley 21-Mar-11 7:11am    
In your client application
Rajesh Kumar Chekuri 21-Mar-11 7:13am    
Thanks ..
Rajesh Kumar Chekuri 21-Mar-11 7:16am    
Now also it's not working but it gave different error

at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSectionFromConfigurationManager(String sectionPath)
at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath)
at System.ServiceModel.Configuration.ClientSection.UnsafeGetSection()
at System.ServiceModel.Description.ConfigLoader.LookupChannel(String configurationName, String contractName, Boolean wildcard)
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)
at ECMS.UnitTests.TestCurriculumManagement.SyllabusReportRetrieval() in D:\objmap\src\tests\ECMS.ServiceTest\TestCurriculumManagement.cs:line 912
Dylan Morley 21-Mar-11 7:21am    
Don't copy the whole entry in, that was just an example.

Did you amend your entries in the ECMSBindingConfig entry? e.g.

maxReceivedMessageSize="8192" maxBufferSize="8192"

Change these ^^^
i solve the problem .... i changed configuration as follows..

XML
<bindings>
      <netTcpBinding>
        <binding name="ECMSBindingConfig" closeTimeout="00:10:00" openTimeout="00:10:00"
          sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647" portSharingEnabled="true">
          <readerQuotas maxArrayLength="2147483647" maxNameTableCharCount="2147483647"
              maxStringContentLength="2147483647" maxDepth="2147483647"
              maxBytesPerRead="2147483647" />
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ECMSServiceBehavior">
          <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="2147483647" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceTimeouts transactionTimeout="00:10:00" />
          <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="100"
            maxConcurrentInstances="100" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900