Advertisement
patryk_szwed

WcfService1 IService1

Jun 3rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 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.ServiceModel.Web;
  7. using System.Text;
  8.  
  9. namespace WcfService1
  10. {
  11. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
  12. [ServiceContract]
  13. public interface IService1
  14. {
  15.  
  16. [OperationContract]
  17. string GetData(int value);
  18. [OperationContract]
  19. int Factorial(int value);
  20.  
  21. [OperationContract]
  22. CompositeType GetDataUsingDataContract(CompositeType composite);
  23.  
  24. // TODO: Add your service operations here
  25. }
  26.  
  27.  
  28. // Use a data contract as illustrated in the sample below to add composite types to service operations.
  29. [DataContract]
  30. public class CompositeType
  31. {
  32. bool boolValue = true;
  33. string stringValue = "Hello ";
  34.  
  35. [DataMember]
  36. public bool BoolValue
  37. {
  38. get { return boolValue; }
  39. set { boolValue = value; }
  40. }
  41.  
  42. [DataMember]
  43. public string StringValue
  44. {
  45. get { return stringValue; }
  46. set { stringValue = value; }
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement