Advertisement
Guest User

ICalculator.cs

a guest
Jul 13th, 2010
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 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 WcfService {
  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 ICalculator {
  13.  
  14.         [OperationContract]
  15.         string GetData(int value);
  16.  
  17.         [OperationContract]
  18.         CompositeType GetDataUsingDataContract(CompositeType composite);
  19.  
  20.         // TODO: Add your service operations here
  21.     }
  22.  
  23.  
  24.     // Use a data contract as illustrated in the sample below to add composite types to service operations.
  25.     [DataContract]
  26.     public class CompositeType {
  27.         bool boolValue = true;
  28.         string stringValue = "Hello ";
  29.  
  30.         [DataMember]
  31.         public bool BoolValue {
  32.             get { return boolValue; }
  33.             set { boolValue = value; }
  34.         }
  35.  
  36.         [DataMember]
  37.         public string StringValue {
  38.             get { return stringValue; }
  39.             set { stringValue = value; }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement