ServiceClient serviceClient;
try
{
//create ServiceClient
//Service method call
}
catch (System.ServiceModel.FaultException ex)
{
throw;
}
catch (Exception ex)
{
throw;
}
finally
{
if (serviceClient != null)
serviceClient.close()
}
With this code you can put a break point within the catch(System.ServiceModel.FaultException ex) block and inspect the fault exception as seen in the image below.
Showing posts with label WCF Fault Exception. Show all posts
Showing posts with label WCF Fault Exception. Show all posts
Wednesday, 23 October 2013
Catching WCF FaultException in ASP.NET Web Application
If you are making WCF method calls from your app it will be handy if your code give error details when something goes wrong with the WCF call. This can be done by adding a catch(System.ServiceModel.FaultException){} block within your code.
Subscribe to:
Posts (Atom)
