Monday 15 April 2013

configuration - WCF - When object to transfer has a list of more than 127 objects -


I use WCF with Code First (VS2012, .NET 4.0, WCF5). Everything works fine until I want to move a big object. There is a list of many other items in it. Each object contains only small content, if this list is longer than 127 objects, then I get an exception:

The server did not provide a meaningful answer ; This may be due to a contract mismatch, one session prematurely closed or internal server error.

I've found that reducing the number of columns in the database (try and error)

I use the following configuration on the client:

  & lt; System.serviceModel & gt; & Lt; Binding & gt; & Lt; NetTcpBinding & gt; & Lt; Binding name = "net TCP binding _ **** _ service" passtimeout = "00:00:10" opentimeout = "00:00:10" received timeout = "00:05:00" Sent timeout = "00:05: 00 "Max buffer size =" 2147483647 "MaxbufrSissage =" 2147483647 "MaxRexerve Messages =" 2147483647 "& gt; & Lt; Readerkots Mksdepth = "2147483647" Mgstringkantentlength = "2147483647" Msrrylength = "2147483647" Maksbitsperread = "2147483647" Mksonmetablecrsunt = "2147483647" / & gt; & Lt; / Binding & gt; & Lt; / NetTcpBinding & gt; & Lt; / Binding & gt; & Lt; Customers & gt; & Lt; Endpoint address = "net.tcp: // localhost: 8000 / ****" binding = "net TCP binding" binding configuration = "****" contract = "****" name = "net TCP binding _ **** service "& gt; & Lt; Identity & gt; & Lt; UserPrincipalName value = "****" /> & Lt; / Identification & gt; & Lt; / Endpoint & gt; & Lt; / Customer & gt; & Lt; /system.serviceModel>   

The server configuration looks like this:

  & lt; System.serviceModel & gt; & Lt; Binding & gt; & Lt; NetTcpBinding & gt; & Lt; Compulsive name = "net TCPbinding _ **** _ service" close timeout = "00:00:10" opentimeout = "00:00:10" received timeout = "00:05:00" Sent timeout = "00:05: 00 "transfer mode =" bufferd "maxbuffarpool size =" 2147483647 "maxbfarseases =" 2147483647 "maxconnection =" 0 "maxxaxed message =" 2147483647 "& gt; & Lt; ReaderQuotas maxDepth = "100000" Maximum string content length = "100000" MaxArray lange = "100000" MaxbitspearRead = "100000" Maximum NameTableCashCashCount = "100000" /> & Lt; Trusted session enabled = "incorrect" /> & Lt; / Binding & gt; & Lt; / NetTcpBinding & gt; & Lt; / Binding & gt; & Lt; Services & gt; & Lt; Service name = "****" & gt; & Lt; Endpoint address = "" binding = "net TCP binding" binding configuration = "net TCP binding _ **** _ service" contract = "****" /> & Lt; Endpoint address = "max" binding = "maxcp binding" binding configuration = "" contract = "iamatadataexchange" /> & Lt; Host & gt; & Lt; BaseAddresses & gt; & Lt; BaseAddress = "net.tcp: // localhost: 8000 / ****" /> Add & lt; / BaseAddresses & gt; & Lt; / Host & gt; & Lt; / Services & gt; & Lt; / Services & gt; & Lt; Behavior & gt; & Lt; ServiceBehaviors & gt; & Lt; Transaction name = "" & gt; & Lt; ServiceMetadata httpGetEnabled = "false" /> & Lt; The services included in the debugging include exceptions = DishialInstine = "false" /> & Lt; / Behavior & gt; & Lt; / ServiceBehaviors & gt; & Lt; / Behavior & gt; & Lt; /system.serviceModel>   

Please trick the mask of some names. I need to avoid the fact that portraits can be attracted by these names about the project. First, set this property to server side (only for Dev)

  & lt; ServiceDiibg includes Exposition Dictures Infults = "True" />   

Specifies whether the client has to include the managed exception information in the SOAP Defect Statement details for debugging purposes.

It is certain that there is something wrong with processing your request but you do not have any debug info. That is why you have to set this property. You can also turn on WCF tracing but it A little more difficult.

WCF has many quotas: A quota is a difficult limit which prevents the use of additional resources when the quota is higher than the value.

There are two quotas in particular that you need to be aware of sending large data: maximum received messages and MaxItem In Object.

No comments:

Post a Comment