[mono-android] How to detect and handle FaultException returned rom WCF

Nirban Dutta Nirban.Dutta at projectCentre.net
Wed Nov 2 02:24:10 EDT 2011


Hi Jon,



I could not catch FaultException returned from WCF calls, instead it is always caught as Serialization Exception as given below:





{System.Runtime.Serialization.SerializationException: Expected element 'ExceptionDetail' in namespace 'http://schemas.datacontract.org/2004/07/System.ServiceModel', but found Element node 'InvalidRequestFault' in namespace 'http://schemas.datacontract.org/2004/07/PC.WcfService'



  at System.Runtime.Serialization.XmlFormatterDeserializer.Deserialize (System.Xml.XmlReader reader, System.Type declaredType, System.Runtime.Serialization.KnownTypeCollection knownTypes, IDataContractSurrogate surrogate, System.Runtime.Serialization.DataContractResolver resolver, System.Runtime.Serialization.DataContractResolver defaultResolver, System.String name, System.String ns, Boolean verifyObjectName) [0x0003e] in /home/jon/Development/xamarin/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs:63



  at System.Runtime.Serialization.DataContractSerializer.ReadObject (System.Xml.XmlDictionaryReader reader, Boolean verifyObjectName) [0x00024] in /home/jon/Development/xamarin/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:344



  at System.Runtime.Serialization.XmlObjectSerializer.ReadObject (System.Xml.XmlDictionaryReader reader) [0x00000] in /home/jon/Development/xamarin/mono/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlObjectSerializer.cs:74



  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00119] in /home/jon/Development/xamarin/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:542



  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00038] in /home/jon/Development/xamarin/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:486



  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in /home/jon/Development/xamarin/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:466 }


For the same reason, I cannot analyse the FaultCode to take necessary action from the android application

Regards,



Nirban Dutta



Software Engineer

[cid:image001.jpg at 01CC9984.3B8CD580]<www.projectcentre.net>



P 1300 653 420 | M +61 432 675 543

[cid:image002.jpg at 01CC9984.3B8CD580]

F +61 (0) 2 9420 8277

3 / 11 Orion Road, Lane Cove, NSW, Australia 2066

CADX PTY LTD DISCLAIMER: The information contained in this email message is CONFIDENTIAL INFORMATION, and may also be LEGALLY PRIVILEGED, intended only for the individual or entity named above. If you are not the intended recipient, you are hereby notified that any use, review, dissemination, distribution or copying of this document is strictly prohibited. If you have received this document in error, please immediately notify us by email and destroy the original message. CADX disclaims all liability and responsibility for any direct or indirect loss or damage that may be suffered by any recipient of this message

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111102/73583b3c/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 9716 bytes
Desc: image001.jpg
Url : http://lists.ximian.com/pipermail/monodroid/attachments/20111102/73583b3c/attachment-0002.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 25096 bytes
Desc: image002.jpg
Url : http://lists.ximian.com/pipermail/monodroid/attachments/20111102/73583b3c/attachment-0003.jpg 


More information about the Monodroid mailing list