I have a WCF service with the following method:
[OperationContract]
TernaryWebServiceResponse<long> ModifyObservations(...);
Response object is as following:
[DataContract]
public class TernaryWebServiceResponse<T>
{
[DataMember]
public TernaryProcessingResultStatus ProcessingSuccessStatus { get; set; }
[DataMember]
public Dictionary<T, bool> ProcessingSuccessDetails { get; set; }
}
This class is defined in a shared assembly and WCF reference is configured to reuse it.
But when I generate the proxy, I get something like this:
Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Referenced type 'TernaryWebServiceResponse`1, General, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contract name 'TernaryWebServiceResponseOflong' in namespace 'http://schemas.datacontract.org/2004/Genaral.SoapCommunication' cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types.
Can somebody plz explain me, what is exactly the problem here? I know that generics can be used in WCF contracts as long as they are resolved, e.g. not MyObj<T>
but MyObj<long>
. So what's wrong with this class? Is it that T defined on the class cannot be somehow resolved on the dictionary?