I am try send Dictionary to WCF service. However if the objcte type is Array or List, it will show me the error " There was an error while trying to serialize parameter......."
There was an error while trying to serialize parameter http://tempuri.org/:str. 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.
This is my WCF Service:
[OperationContract]
int PDFImport(string server,
string repo,
string username,
string password,
string templateName,
string entryName,
byte[] image,
Dictionary<string, Object> value,
string entryPath = @"\1. Incoming",
string volume = "DEFAULT");
Also try to adding some ServiceKnowType Attributes, but still not working
[ServiceContract]
[ServiceKnownType(typeof(Dictionary<string, string>))]
[ServiceKnownType(typeof(Dictionary<string, object>))]
[ServiceKnownType(typeof(Dictionary<string, List<string>>))]
[ServiceKnownType(typeof(List<Dictionary<string, List<string>>>))]
Please help me out. Thanks in advance.