Jun 5, 2007

WCF callback service

This is a simple WCF service contract with a callback contract:


[ServiceContract(Namespace = "http://www.mleder.blogspot.com/WCF/Service"

, CallbackContract=typeof(IDeviceServerCallbackService))]

public interface IDeviceServerService

{

[OperationContract]

[FaultContract(typeof(ServiceOperationFault))]

DoWorkResponse DoWork(DoWorkRequest myValue);

[OperationContract]

Role[] GetRoles();

}

Please note that:

  • even as the callback contract interface is implemented on the client side, the semantical naming is related to the service name
  • DoWork is a generic web operation that concentrates all service calls and routes requests to the corresponding business object

No comments:

Post a Comment