OperationContract.cs 766 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.ServiceModel;
  5. using System.Threading;
  6. namespace MonoTests.Features.Contracts
  7. {
  8. // Define a service contract.
  9. [ServiceContract (Namespace = "http://MonoTests.Features.Contracts")]
  10. public interface IOperationContract
  11. {
  12. [OperationContract (Name = "RenamedMethod")]
  13. int OrigMethod ();
  14. [OperationContract (Name = "OrigMethod")]
  15. int RenamedMethod ();
  16. [OperationContract (IsOneWay = true)]
  17. void Sleep (int mili);
  18. }
  19. public class OperationContractServer : IOperationContract
  20. {
  21. public int OrigMethod () { return 1; }
  22. public int RenamedMethod () { return 2; }
  23. public void Sleep(int mili)
  24. {
  25. Thread.Sleep(mili);
  26. }
  27. }
  28. }