Xamarin Android - WCF Fault Exception Cannot Deserialize FaultDetail

247 views Asked by At

Our application has always thrown FaultException with a generic type argument. In Silverilght, WCF, and UWP, the FaultException can be deserialized on the client side and the client gets a meaningful error message with a FaultDetail on the other side.

On Android we noticed that FaultDetails are not being correctly deserialized when a FaultException<> has been thrown from the WCF call. I dug in to this and found that this is a legitimate bug in the Xamarin Android Mono WCF environment. Android will accept a FaultException if there are no generic type arguments, but if a generic type argument is specified, it will not be able to deserialize the error message, and it will throw a useless error message as a generic Exception message.

I have logged this as a bug with the Xamarin team here: https://bugzilla.xamarin.com/show_bug.cgi?id=59318

You can see this bug being recreated in the TODOWCF sample in this repo which is a fork of the Xamarin Forms samples: https://github.com/MelbourneDeveloper/xamarin-forms-samples.git

So, my question is: has anyone been able to successfully throw a FaultException with a generic type argument (FaultDetail) to a Xamarin Android app, and have the Android app correctly deserialize the FaultException message?

Edit: this is a confirmed bug on Android and iOS. https://bugzilla.xamarin.com/show_bug.cgi?id=59318#c3

1

There are 1 answers

0
Christian Findlay On BEST ANSWER

This bug in Xamarin has been logged here: https://bugzilla.xamarin.com/show_bug.cgi?id=59318