wcf binding - WCF call times out when the returned message is large -


we have system client flash application calling asmx based search web service in turn calls wcf service hosted in windows service using nettcpbinding. working fine when no. of search results small. when search results going large, in range of 2000 records, getting exception in asmx service calls wcf:

`the communication object, system.servicemodel.channels.servicechannel, cannot used communication because in faulted state.` 

in order troubleshoot error, enabled service tracing , found error reported is:

`the socket connection aborted. caused error processing message or receive timeout being exceeded remote host, or underlying network resource issue. local socket timeout '00:01:00'.`  

we have increased timeout values in both server , client configs , increased maxitemsinobjectgraph value. there no errors happening @ wcf call can debug , observed behavior is, when wcf call returns, code in asmx service hitting exception block , reporting above error.

server side config:

<system.servicemodel> <services>   <service name="***.searchcontroller" behaviorconfiguration="servicebehavior">     <endpoint address="net.tcp://localhost:8228/searchcontroller" binding="nettcpbinding" contract="***.isearch" name="searchcontroller" />   </service> </services> <behaviors>   <servicebehaviors>     <behavior name="servicebehavior">       <servicedebug includeexceptiondetailinfaults="true" />       <datacontractserializer maxitemsinobjectgraph="2147483647"/>     </behavior>   </servicebehaviors> </behaviors> <bindings>   <nettcpbinding>     <binding name="largemessagebinding"              maxbufferpoolsize="2147483647"              maxbuffersize="2147483647"              maxconnections="2147483647"              maxreceivedmessagesize="2147483647"              portsharingenabled="false"              transactionflow="false"              listenbacklog="2147483647"              closetimeout="infinite"               opentimeout="infinite"               receivetimeout="infinite"               sendtimeout="infinite">       <security mode="none">         <message clientcredentialtype="none"/>         <transport protectionlevel="none" clientcredentialtype="none"/>       </security>       <reliablesession enabled="false"/>       <readerquotas maxdepth="2147483647"          maxstringcontentlength="2147483647"          maxarraylength="2147483647"          maxbytesperread="2147483647"          maxnametablecharcount="2147483647" />     </binding>   </nettcpbinding> </bindings> <diagnostics wmiproviderenabled="true">   <messagelogging          logentiremessage="true"          logmalformedmessages="true"          logmessagesatservicelevel="true"          logmessagesattransportlevel="true"          maxmessagestolog="3000"    /> </diagnostics> <client></client> 

client(axms) side config:

<system.servicemodel>     <client>   <endpoint address="net.tcp://localhost:8228/searchcontroller" binding="nettcpbinding" behaviorconfiguration="endpointbehavior" contract="***.isearch" name="newsearch"/> </client>     <bindings>   <nettcpbinding>     <binding name="largemessagebinding"              maxbufferpoolsize="2147483647"              maxbuffersize="2147483647"              maxconnections="2147483647"              maxreceivedmessagesize="2147483647"              portsharingenabled="false"              transactionflow="false"              listenbacklog="2147483647"              closetimeout="infinite"              opentimeout="infinite"              receivetimeout="infinite"              sendtimeout="infinite">       <security mode="none">         <message clientcredentialtype="none"/>         <transport protectionlevel="none" clientcredentialtype="none"/>       </security>       <reliablesession enabled="false"/>       <readerquotas maxdepth="2147483647"          maxstringcontentlength="2147483647"          maxarraylength="2147483647"          maxbytesperread="2147483647"          maxnametablecharcount="2147483647" />     </binding>   </nettcpbinding> </bindings> <behaviors>   <endpointbehaviors>     <behavior name="endpointbehavior">       <datacontractserializer maxitemsinobjectgraph="2147483647"/>     </behavior>   </endpointbehaviors> </behaviors> </system.servicemodel> 

the code using wcf gets called asmx service:

list<***.searchresult> results;     using (var searchfactory = new channelfactory<***.isearch>("newsearch"))     {         legacy.isearch searchproxy = searchfactory.createchannel();         results = searchproxy.search(searchoption);     } 

this call reporting exception.

we not sure why getting timeout issue after increasing thresholds in config. service not picking our binding config , using default config values , hence throwing error. not sure way validate if service has picked our config @ runtime. need in troubleshooting issue.

you must use binding in application, declare only, use bindingconfiguration property

<endpoint address="net.tcp://localhost:8228/searchcontroller" binding="nettcpbinding" contract="***.isearch" name="searchcontroller" bindingconfiguration="largemessagebinding" /> 

and bindingconfiguration="largemessagebinding" client config too


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -