Hi
I'm writing WCF Service functions that will run on Azure. This is my interface, class and enum on the server site:
[ServiceContract]
public interface ICertificateService
{
[OperationContract]
Task<Certificate> GetCertificateAsync(long serialNumber);
[OperationContract]
void GetCertificateWithCallback(long serialNumber, Action<Certificate> callback);
}
[DataContract]
public class Certificate
{
[DataMember]
public long serialNumber { get; set; }
DataMember]
public byte[] Document { get; set; }
[DataMember]
public ECertificateType CertificateType { get; set; }
}
[DataContract]
public enum ECertificateType
{
[EnumMember]
NONE = 0,
[EnumMember]
Single = 1,
[EnumMember]
Combined = 2
}
If I comment out the following
then I can see and use my other function GetCertificateAsync(...) on the client side after adding a Service Reference. But if I do not comment out the code above then I cannot see any of the two functions on the client side even though I have no compile errors on server side.
I think the problem is the callback
Action<Certificate> callback
So how do I write the WCF function GetCertificateWithCallback(...) below? What should be done in the interface to use Action<Certificate> callback?
[OperationContract]
void GetCertificateWithCallback(long serialNumber, Action<Certificate> callback);