Am getting an error mentioned below when I call my WCF service?How do i get rid of it?
There was an error while trying to serialize parameter http://tempuri.org/:MyWCFSvc.svc
The InnerException message was ‘Type ‘System.String[]’ with data contract name ‘ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays‘
is not expected. Add any types not known statically to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.’. Please see InnerException for more details.*
I tried using [ServiceKnownType(typeof(string[]))] in my WCF service interface but no luck
A year late, but I had the same issue and here is what you need to do
The problem is when you construct your serializer with the typeof your class, the serialzer does not see it as an arrray, it only sees a single object.
If found it by doing this first: