0

I host WCF connection using topshelf and service configurations use behavior and tcp connection like the following :

<behaviors>
  <serviceBehaviors>
    <behavior name="MetaDataBehvior">
      <serviceMetadata />
    </behavior>
    <behavior>
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

<bindings>
  <netTcpBinding>
    <binding name="NetTcpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
      <security mode="Transport">
        <!--Transport security is enabled Because all machinses on the same Domain (intranet) -->
        <!-- http://www.karthikscorner.com/sharepoint/wcf-transport-security/ -->
        <!--Transport security is enabled-->
          <transport clientCredentialType="Windows"
                    protectionLevel="EncryptAndSign" />
      </security>
    </binding>
  </netTcpBinding>
</bindings>

I tried even using throttling but nothing change after several usages of the service I got the error :

One or more errors occurred.

System.AggregateException: One or more errors occurred. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9844041'. ---> System.IO.IOException: The write operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9844041'.

any advice how to trace or fix this

fiat
  • 15,501
  • 9
  • 81
  • 103
Ali
  • 1,975
  • 5
  • 36
  • 55

1 Answers1

0

WCF contains a few classes that you can use to trace/debug your application

The first would be enabling Trace logging/message logging, you can use the SvcConfigEditor to make your life simpler enter image description here

Then just go into the EndToEnd Tracing section and edit the configuration to suite your needs,

using tracing in conjuction with messaging will give you a way to relate the messageID( a guid) with the trace that is produced, and in some cases find the message that is giving you issues.

The other thing you can check is enabling the ServiceAudit tag in your ServiceBehavior settings, this will allow you to check security events that arise from your service.

enter image description here

mahlatse
  • 1,322
  • 12
  • 24