patryk_szwed

Iservice1

May 13th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. using System.ServiceModel;
  6. using System.Text;
  7.  
  8. namespace WcfServiceLibrary1
  9. {
  10. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
  11. [ServiceContract]
  12. public interface ICCalculator
  13. {
  14. [OperationContract]
  15. ComplexNum addCNum(ComplexNum n1, ComplexNum n2);
  16.  
  17. [OperationContract]
  18. void Function1(String s1);
  19.  
  20. [OperationContract(IsOneWay = true)]
  21. void Function2(String s2);
  22. }
  23.  
  24. [DataContract]
  25. public class ComplexNum
  26. {
  27. private string desc = "Complex number";
  28.  
  29. [DataMember] public double realPart;
  30. [DataMember] public double imagPart;
  31.  
  32. [DataMember]
  33. public string Desc
  34. {
  35. get
  36. {
  37. return desc;
  38.  
  39. }
  40. set { desc = value; }
  41. }
  42.  
  43. public ComplexNum(double rp, double ip)
  44. {
  45. this.realPart = rp;
  46. this.imagPart = ip;
  47. }
  48. }
  49. }
Add Comment
Please, Sign In to add comment