0

I'm new in using WCF, but i used the same way in other projects but not sure why it keeps gives below error. So the service keeps failing and stop continue with the rest of the code.

InnerChannel = 'client.InnerChannel' threw an exception of type 'System.ServiceModel.CommunicationObjectFaultedException'

the error appears in debug after the first line below

SvcSoapClient client = new SvcSoapClient(SvcSoapClient.EndpointConfiguration.SvcSoap12);
var temp = await client.getSvcAsync("0" + num, error);
GsvS
  • 1
  • When a faulty communication object is called, a [CommunicationObjectFaultedException](https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.communicationobjectfaultedexception?view=dotnet-plat-ext-6.0) will be thrown. You can [configure tracing](https://learn.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/tracing/configuring-tracing) or handle accurate exceptions in the service and client code, – Lan Huang Dec 23 '21 at 07:05
  • that is, [include CommunicationException in the Try Catch block on the client side](https://learn.microsoft.com/en-us/dotnet/framework/wcf/samples/expected-exceptions?redirectedfrom=MSDN), and then view the exact error. – Lan Huang Dec 23 '21 at 07:05
  • what i should be looking for ? i tired to Catch the error but still not sure what to do or how to fix it ? as the WCF working for sometime and sometime not, the message received in the catch is "The communication object, System.ServiceModel.ChannelFactory`1[SvcSoap], cannot be used for communication because it is in the Faulted state." – GsvS Dec 23 '21 at 12:47
  • Client service proxies cannot be reused once they have faulted. You must dispose of the old one and recreate a new one.You can take a look at [this post](https://stackoverflow.com/questions/69886179/how-to-deal-with-communicationobjectfaultedexception) and the links provided in it. – Lan Huang Dec 24 '21 at 02:06

0 Answers0