I have fall under the same situation as per this question however, this is the difference is that the existing question has the access to server code to throw FaultException if Stream is null while I'm consuming a supplier web service whereby it returns Stream.Null
is the web service is null.
We did try to request supplier to change the method to throw fault however the reason given by supplier is that there are existing other system that consume this and changing from returning Stream.Null
might potentially break other system instead.
I was wondering if anyone would be able to teach me how to perform Null Checking on Stream.Null please?
I have tried == null
and it seems not working. The webservice is bind using Web Reference towards WCF.
Update
I have found that returning Stream.Null via WCF will result CanSeek = false (as per what is mentioned in one of the comment as below (Well, at least it is what being returned from my supplier web service.). Does this mean that every stream returned from WCF is CanSeek = false and unable to find the length?