0

I am getting the following exception without insight of what is exactly getting wrong.

System.ServiceModel.CommunicationObjectFaultedException: 'The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.'

I know this is happening due to deserializing DataContract on the business side of the wire. There is DataContract equivalence in place on both sides of the wire (Client and Business).

Due to the complexity of the domain its difficult to add reference here but so far I have been isolating and resolving these issues by removing [DataMember] from the properties of the [DataContract] in the client side of the wire. I can continue resolving this way but that is a tedious job for me and quite time taking so I am just curious to know if WCF can itself pinpoint the issue by providing details in the returned exception at the client side.

My service app.config

<system.serviceModel>
    <services>
      <service name="FSX.Business.Managers.ExecutionManager" 
               behaviorConfiguration="Debugging">
        <endpoint address="net.tcp://localhost:8009/ExecutionService"
                  binding="netTcpBinding"
                  contract="FSX.Business.Contracts.IExecutionService" />
      </service>          
    </services>
    <bindings>
      <netTcpBinding>
        <binding maxReceivedMessageSize="2000000" transactionFlow="true">
          <reliableSession enabled="true"/>
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Debugging">
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
</system.serviceModel>

I have read numerous posts including few mentioned below but still not able work that out. Although I have added the custom implementation of IErrorHandler.

Furqan Safdar
  • 16,260
  • 13
  • 59
  • 93
  • Ability of WCF to send information why server fails depends on server configuration. If `includeExceptionDetailsInFaults` is not set, then client will not get enough information. – Igor Labutin Jul 09 '18 at 08:09
  • If you see the app.config above, includeExceptionDetailInFaults is already set to true yet not receiving any detailed reason for the failure. – Furqan Safdar Jul 11 '18 at 11:35
  • Ah, sorry. Actually when WCF cannot deserialize 'input' object, then this option does not work. It only works for exceptions produced by your service code, not by WCF infrastructure. – Igor Labutin Jul 12 '18 at 09:38

0 Answers0