public StringData FlipTheCase(StringData sd)
 {
     sd.FlippedCaseString = null;
       foreach (char c in sd.OriginalString)
       {
     sd.FlippedCaseString += char.IsLower(c) ?
       c.ToString().ToUpper() : c.ToString().ToLower();
       }
       return sd;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            EndpointAddress ep = new EndpointAddress("http://localhost:8080/flipcase/basic");

              IFlipCaseService proxy = ChannelFactory<IFlipCaseService>.CreateChannel(new BasicHttpBinding(), ep);

              StringData stringData = new StringData() { OriginalString = "Hello, FlipCase!" };
              StringData result = proxy.FlipTheCase(stringData);

              Console.WriteLine("Result: {0}=>{1}",result.OriginalString,result.FlippedCaseString);
              Console.WriteLine("Press <ENTER> to terminate the client.");
              Console.ReadLine();
        }