Nishanth J

Nishanth J

  • NA
  • 855
  • 13.6k

Listening at Endpoint connecting to WCF net.tcp protocol

May 9 2020 6:39 AM
This weird Error was appearing from one day before posting this post. Previously it was working fine, but not now.
At one movement restarting the system, the error disappears and able to access the application.
and after again rebooting the system the error begins to appear without knowing the root cause.
Enabled Protocols: `net.tcp,http`
I could able to browse the below link
  • http://localhost/TNA/TAServices/AuthenticationManager.svc
  • http://username.domainname.com/TAServices/AuthenticationManager.svc?wsdl
  • http://username.domainname.com/TAServices/AuthenticationManager.svc?singleWsdl
Here is the below snippet which causes an exception
  1. objCheckUserLoginResponse = AuthenticationManagerClient.Check(objCheckUserLoginRequest, objCustomer);  
Exception:
The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/TAServices/AuthenticationManager.svc' is unavailable for the protocol of the address.
System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/TNA/TAServices/AuthenticationManager.svc' is unavailable for the protocol of the address.
Server stack trace:
at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty& remoteSecurity)
at System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
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]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at TA.ServiceProxy.AuthenticationManager.IAuthenticationManager.Check(CheckUserLoginRequest1 request)
at TA.ServiceProxy.AuthenticationManager.AuthenticationManagerClient.TA.ServiceProxy.AuthenticationManager.IAuthenticationManager.Check(CheckUserLoginRequest1 request) in D:\2017_TFS\TestandAssessment\Dev\Manifest\TestPrepAdmin\ServiceProxy\Service References\AuthenticationManager\Reference.cs:line 3370
at TA.ServiceProxy.AuthenticationManager.AuthenticationManagerClient.Check(CheckUserLoginRequest Request, Customer Customer) in D:\2017_TFS\TestandAssessment\Dev\Manifest\TestPrepAdmin\ServiceProxy\Service References\AuthenticationManager\Reference.cs:line 3377
at TA.UIFrameWork.AuthenticationManagement.AuthenticateUser(CheckUserLoginRequest objCheckUserLoginRequest) in D:\2017_TFS\TestandAssessment\Dev\Manifest\TestPrepAdmin\UIFrameWork\Authentication\AuthenticationManagement.cs:line 19
T: 2020-05-09 12:19:52,242 |L: INFO |TH: 8 |L: Utilities.PageBase |MSG:
SessionID: Method: LoadLanguages
Info: Page: Login.aspx Method: LoadLanguages Enters
AuthenticationManagement.cs
  1. using TA.ServiceProxy.AuthenticationManager;  
  2. using System;  
  3. namespace TA.UIFrameWork  
  4. {  
  5. public class AuthenticationManagement  
  6. {  
  7. public CheckUserLoginResponse AuthenticateUser(CheckUserLoginRequest objCheckUserLoginRequest)  
  8. {  
  9. Customer objCustomer;  
  10. CheckUserLoginResponse objCheckUserLoginResponse = null;  
  11. try  
  12. {  
  13. objCustomer = new Customer();  
  14. objCustomer.CustomerName = "ABC";  
  15. objCustomer.CultureInfo = "English";  
  16. AuthenticationManagerClient AuthenticationManagerClient = new AuthenticationManagerClient();  
  17. AuthenticationManagerClient.Open();  
  18. objCheckUserLoginResponse = AuthenticationManagerClient.Check(objCheckUserLoginRequest, objCustomer);  
  19. AuthenticationManagerClient.Close();  
  20. AuthenticationManagerClient = null;  
  21. objCustomer = null;  
  22. objCheckUserLoginRequest = null;  
  23. }  
  24. catch (Exception ex)  
  25. {  
  26. LoggingFramework.log.Error(ex.Message, ex);  
  27. }  
  28. return objCheckUserLoginResponse;  
  29. }  
  30. }  
  31. }  
  32. }  
web.config
  1. <?xml version="1.0"?>  
  2. <configuration>  
  3. <configSections>  
  4. <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" />  
  5. <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />  
  6. <section name="dns" type="System.Configuration.NameValueFileSectionHandler" />  
  7. </configSections>  
  8. <dataConfiguration defaultDatabase="LocalSqlServer" />  
  9. <dns file="dns.config" />  
  10. <system.web>  
  11. <!-- Web Part -->  
  12. <membership>  
  13. <providers>  
  14. <clear />  
  15. <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" applicationName="/MVCFramework" />  
  16. </providers>  
  17. </membership>  
  18. <profile enabled="true" defaultProvider="TableProfileProvider">  
  19. <providers>  
  20. <clear />  
  21. <add name="TableProfileProvider" type="Microsoft.Samples.SqlTableProfileProvider" connectionStringName="LocalSqlServer" table="aspnet_Profile" applicationName="/MVCFramework" />  
  22. </providers>  
  23. </profile>  
  24. <!-- End Web Part -->  
  25. <pages validateRequest="false" enableEventValidation="false" enableViewStateMac="false" maintainScrollPositionOnPostBack="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">  
  26. <controls>  
  27. <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />  
  28. </controls>  
  29. </pages>  
  30. <customErrors mode="Off">  
  31. <error statusCode="403" redirect="Status.aspx" />  
  32. <error statusCode="404" redirect="Status.aspx" />  
  33. </customErrors>  
  34. <httpCookies httpOnlyCookies="true">  
  35. </httpCookies>  
  36. <trace enabled="false" localOnly="true">  
  37. </trace>  
  38. <httpRuntime maxRequestLength="2097151" executionTimeout="220000" requestValidationMode="2.0" />  
  39. <!--  
  40. Set compilation debug="false" to insert debugging  
  41. symbols into the compiled page. Because this  
  42. affects performance, set this value to true only  
  43. during development.  
  44. -->  
  45. <compilation debug="true" defaultLanguage="c#" targetFramework="4.0">  
  46. <assemblies>  
  47. </assemblies>  
  48. <buildProviders>  
  49. <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />  
  50. </buildProviders>  
  51. </compilation>  
  52. <sessionState mode="InProc" timeout="6000" cookieless="UseCookies">  
  53. </sessionState>  
  54. <authorization>  
  55. <allow users="?" />  
  56. </authorization>  
  57. <httpHandlers>  
  58. <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />  
  59. <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />  
  60. </httpHandlers>  
  61. </system.web>  
  62. <system.net>  
  63. <settings>  
  64. <servicePointManager expect100Continue="false" />  
  65. </settings>  
  66. </system.net>  
  67. <system.webServer>  
  68. <security>  
  69. <requestFiltering>  
  70. <requestLimits maxAllowedContentLength="1024000000"></requestLimits>  
  71. </requestFiltering>  
  72. </security>  
  73. <validation validateIntegratedModeConfiguration="false" />  
  74. <handlers>  
  75. <remove name="ChartImageHandler" />  
  76. <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />  
  77. </handlers>  
  78. <modules>  
  79. <add name="QueryStringValidation" type="Presentation.Utilities.QueryStringValidation" />  
  80. </modules>  
  81. </system.webServer>  
  82. <system.data>  
  83. <DbProviderFactories>  
  84. <remove invariant="MySql.Data.MySqlClient" />  
  85. <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />  
  86. </DbProviderFactories>  
  87. </system.data>  
  88. <system.serviceModel>  
  89. <bindings>  
  90. <basicHttpBinding>  
  91. <binding name="BasicHttpBinding_Framework" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">  
  92. <readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="4096" maxNameTableCharCount="16384" />  
  93. <security mode="None"/>  
  94. </binding>  
  95. </basicHttpBinding>  
  96. <netTcpBinding>  
  97. <binding name="NetTcpBinding_Framework" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:51:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="999999999" maxBufferSize="999999999" maxConnections="10" maxReceivedMessageSize="999999999">  
  98. <readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="4096" maxNameTableCharCount="16384" />  
  99. <reliableSession ordered="true" inactivityTimeout="00:50:00" enabled="false" />  
  100. <security mode="None">  
  101. <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />  
  102. <message clientCredentialType="Windows" />  
  103. </security>  
  104. </binding>  
  105. </netTcpBinding>  
  106. </bindings>  
  107. <client>  
  108. <endpoint address="net.tcp://localhost/TNA/TAServices/AccountManager.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Framework" contract="AccountManager.IAccountManager" name="NetTcpBinding_Framework" />  
  109. </client>  
  110. <behaviors>  
  111. <endpointBehaviors>  
  112. <behavior name="ClientBehavior">  
  113. <dataContractSerializer maxItemsInObjectGraph="10000000" />  
  114. </behavior>  
  115. </endpointBehaviors>  
  116. </behaviors>  
  117. </system.serviceModel>  
  118. <location path="Common">  
  119. <system.web>  
  120. <authorization>  
  121. <allow users="?" />  
  122. </authorization>  
  123. </system.web>  
  124. </location>  
  125. <system.web.extensions>  
  126. <scripting>  
  127. <webServices>  
  128. <jsonSerialization maxJsonLength="5000000" />  
  129. </webServices>  
  130. </scripting>  
  131. </system.web.extensions>  
  132. </configuration>  
Without knowing the cause I was not able to do anything.
Please suggest in resolving `EndpointNotFoundException` issue wrt to code or from windows 10 (1903)