WCF: how to diagnose bad channels?

I am working on delivery within my laboratory, which I hope will help diagnose the strange weird strangeness we see. There is a test application that uses DuplexChannelFactory to connect to multiple Windows services, and for some reason, the channels in this test application seem to be a bit wrong. I have plans to implement repetition logic, but it would be great to find out why they are wrong.

I know that there are many interfaces implemented in channel factories and proxy objects, and I used a reflector to scan some of them, but I did not find anything like what I'm looking for. Is there a way to query for these objects after they have been resolved in order to get some information about what caused the error?

Edit: the configuration is very simple - the binding is only the NetTcpBinding built by default, the service implementation has [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Reentrant)], and no special attributes affect any of the operations in the service contract. However, I ask more about the general methods for diagnosing channel errors without diagnosing this particular case. I would not expect configuration features to have too much impact on this; if anything, the configuration details will be returned by the specified diagnostics by something, right?

+3
source share
4 answers

The answers of Ladislav and Shiraz are all good, and I gave them +1.

, , , . , WCF , - , , .

, , , , - FaultException ( http://www.c-sharpcorner.com/UploadFile/ankithakur/ExceptionHandlingWCF12282007072617AM/ExceptionHandlingWCF.aspx)

, WCF , , WSDL, WSDL.

, , , , , , , .

+4

-, , .

, . :

  • -, .
  • , .
+3

The diagnostic tool you are looking for is called WCF tracing . This usually indicates why the channel is defective. You can configure it both on the client and on the server and use SvcTraceViewer.exe to view the collected traces.

+2
source

You are connected to ICommunicationObject.OnFauled

0
source

Source: https://habr.com/ru/post/1768650/


All Articles