Last post Sep 03, 2013 02:26 AM by Steven Cheng - MSFT
Aug 30, 2013 10:28 PM|Mayil_Gilli|LINK
We have developed the web application, here we are calling third party web service to fetch the data, In this case we are getting some exception while calling the WCF web service, some times we have to fix the issue in our web application, some times they
are fixing the issue in WCF Web service code side.
How to identify the exception is in our code or WCF web service exception. if we found this then we can easily tell to user please contact webservice persons or us.
How do we identify this, What are all the exception handling that we need to add in our web application code. Please advise.
Sep 02, 2013 09:37 PM|Amy Peng - MSFT|LINK
We can definitely catch and handle all exceptions that happen on your service class and turn them into a FaultException or FaultException exception.
That way, we won't "fault" (or tear down) the communications channel between our client and server.
Even better approach would be to implement the IErrorHandler interface on our service class that provides a way to globally catch all exceptions as they happen and provide a FaultException instead, that's SOAP compliant.
We can even turn our IErrorHandler into a configurable behavior that can be turned on or off in config.
Please try to refer to these articles and blog posts for more details:
#Useful WCF behaviors: IErrorHandler:
#Exception Handling in WCF:
Sep 03, 2013 02:26 AM|Steven Cheng - MSFT|LINK
In addition to Amy's suggestion, I think it would be quite handy to perform a HTTP request inspection (if the webservice or WCF service use plain HTTP transport). For example, we can use fiddler to capture the HTTP request/response communication of the webservice
server and client to see if the error is returned from the service (after client-side successfully send out the request):
#Fiddler web debugging proxy