建構服務導向應用程式的通用傳輸架構-Indigo 文/沈炳宏 -----box----- #程式1 using System; using System.ServiceModel; [ServiceContract()] public interface IMyService { [OperationContract] string MyOperation1(string myValue1); } public class MyService : IMyService { public string MyOperation1(string myValue1) { return "Hello: " + myValue1; } } -----box----- -----box----- #程式2 try { // Create a proxy with given client endpoint configuration using (MyServiceProxy proxy = new MyServiceProxy("IMyService")) { MessageBox.Show(proxy.MyOperation1("Indigoooooo~")); } } catch (Exception e1) { MessageBox.Show(e1.Message.ToString()); } -----box-----