Skip to main content
Home Forums Silverlight Programming Accessing Web Services with Silverlight Generate error message for e.Error in web service?
1 replies. Latest Post by Klinger on July 6, 2009.
(0)
xkrja
Member
67 points
136 Posts
07-06-2009 11:38 AM |
Is it possible to generate custom error messages which can be shown in the e.Error on the Silverlight side? Let's say I've a method in the web service that contains try-catch blocks. Can I then catch the error in the catch block so that error can be read by the silverlight app in the e.Error message?
Thanks!
Klinger
Participant
1686 points
300 Posts
07-06-2009 2:48 PM |
If you are using WCF and SL 3 there is a way. This video (http://videos.visitmix.com/MIX09/T42F) from MIX09 shows how.
SL3 adds support to faults and this video describes how to configure your service.
If you are not using SL3 accessing the original exception using e.Error is not an option.
In SL2 you will have to return the error as part of your service result.