I have a fixed-sized multidimensional collection exposed via a WCF contract, and I want to be able to return null for any coordinates in the collection that have not been populated. When I try this, I get an exception indicating that this is not supported: "FaultException`1: Object reference not set to an instance of an object."
I wondered whether some flag of OperationContract could be used, but none stand out.
Is what I want possible, or is there some intrinsic restriction within WCF?
Thanks
In WCF nothing prevents you from returning null from any operation contract method.
The exception you get is a FaultException<NullReferenceException> which means somewhere in your server-side code you are referencing an object which is set to null. Check your server-side code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With