Добрый день.
Вопрос: можно ли использовать generic интерфейс в качестве callback в WCF?
Есть вот такой кусок кода службы WCF
public interface IEvents<T>
{
[OperationContract(IsOneWay = true)]
AddEvent(T newItem);
[OperationContract(IsOneWay = true)]
DeleteEvent(int idDeletedItem);
}
[ServiceContract(CallbackContract = typeof(IEvents<User>))]
public interface IUsers
{
[OperationContract(IsOneWay = true)]
void AddUser(string login, string fio);
[OperationContract(IsOneWay = true)]
void DeleteUser(int id);
[OperationContract(IsOneWay = true)]
void Subscribe();
[OperationContract(IsOneWay = true)]
void UnSubscribe();
}
[ServiceContract(CallbackContract = typeof(IEvents<Department>))]
public interface IDepartments
{
[OperationContract(IsOneWay = true)]
void AddDepartment(string name, int state);
[OperationContract(IsOneWay = true)]
void DeleteDepartment(int id);
[OperationContract(IsOneWay = true)]
void ChangeState(int id, int state);
[OperationContract(IsOneWay = true)]
void Subscribe();
[OperationContract(IsOneWay = true)]
void UnSubscribe();
}
public class Service: IUsers, IDepartments
{
.....
}
Сама служба комплируется и запускается нормально, но при попытке получить метаданные возникает ошибка Bad Request, "Metadata contains a reference that cannot be resolved".