M
Michael
Hi All
I have a Problem with sending big Objects or big List<> via WCF.
I wrote a test for this where I generate 2000 Objects and send them in
packages
ahbl.DeleteApplicationHistoryByQuery(q);
Code locks like this:
VoList<ApplicationHistoryVO> list = new VoList<ApplicationHistoryVO>();
for (int i = 0; i < 2000; i++)
{
list.Add(CreateApplicationHistoryVO("<TestCleintInfo>Info " + i +
"</TestCleintInfo>", "Speed Test User", 1, DateTime.Now,
Guid.NewGuid().ToString(), 1, 1));
if (list.Count == 810)
{
ahbl.SaveApplicationHistoryList(list);
list = new VoList<ApplicationHistoryVO>();
}
}
Very easy Code! But every Time my packages get bigger than 826 Items I get
the following Exception
The underlying connection was closed: The connection was closed
unexpectedly. ---> System.Net.WebException: The underlying connection was
closed: The connection was closed unexpectedly
I already add the System.diagnostics to the web and app.config to get the
WCF Exception but nothing. I also take a look in the Event View and there is
also just the “The underlying connection was closed†Exception
Does anyone have an Idea who I can find out where the Problem is?
Regards Michael
WCF Config
Each Endpoint has the following basicHttpBinding and Behavior. The Client
Side is configured the some way.
<basicHttpBinding>
<binding name="Binding" closeTimeout="00:20:00" openTimeout="00:20:00"
receiveTimeout="00:20:00" sendTimeout="00:20:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" transferMode="Buffered" textEncoding="utf-8">
<security mode="None">
<!--Transport-->
<transport clientCredentialType="None"/>
</security>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<behaviors>
<serviceBehaviors>
<behavior name="Behavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
<dataContractSerializer
maxItemsInObjectGraph="2147483647"/>
</behavior>
<behavior name="contactServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
I have a Problem with sending big Objects or big List<> via WCF.
I wrote a test for this where I generate 2000 Objects and send them in
packages
ahbl.DeleteApplicationHistoryByQuery(q);
Code locks like this:
VoList<ApplicationHistoryVO> list = new VoList<ApplicationHistoryVO>();
for (int i = 0; i < 2000; i++)
{
list.Add(CreateApplicationHistoryVO("<TestCleintInfo>Info " + i +
"</TestCleintInfo>", "Speed Test User", 1, DateTime.Now,
Guid.NewGuid().ToString(), 1, 1));
if (list.Count == 810)
{
ahbl.SaveApplicationHistoryList(list);
list = new VoList<ApplicationHistoryVO>();
}
}
Very easy Code! But every Time my packages get bigger than 826 Items I get
the following Exception
The underlying connection was closed: The connection was closed
unexpectedly. ---> System.Net.WebException: The underlying connection was
closed: The connection was closed unexpectedly
I already add the System.diagnostics to the web and app.config to get the
WCF Exception but nothing. I also take a look in the Event View and there is
also just the “The underlying connection was closed†Exception
Does anyone have an Idea who I can find out where the Problem is?
Regards Michael
WCF Config
Each Endpoint has the following basicHttpBinding and Behavior. The Client
Side is configured the some way.
<basicHttpBinding>
<binding name="Binding" closeTimeout="00:20:00" openTimeout="00:20:00"
receiveTimeout="00:20:00" sendTimeout="00:20:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" transferMode="Buffered" textEncoding="utf-8">
<security mode="None">
<!--Transport-->
<transport clientCredentialType="None"/>
</security>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<behaviors>
<serviceBehaviors>
<behavior name="Behavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
<dataContractSerializer
maxItemsInObjectGraph="2147483647"/>
</behavior>
<behavior name="contactServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>