ASP一个很有用的WCF调用编程技巧
日期:08-13  来源:
中国设计秀 作者:cnwebshow.com
并调用相应的方法(这里的方法与服务契约方法一致)即可,所有关于服务调用的细节均被封装在服务代理中。4IL中国设计秀
4IL中国设计秀
1: using System; 2: using Artech.Lib; 3: using Artech.WcfServices.Contracts; 4: namespace Artech.WcfServices.Clients 5: { 6: class Program 7: { 8: static void Main(string[] args) 9: { 10: CalculatorProxy calculatorProxy = new CalculatorProxy(); 11: int result = calculatorProxy.Add(1, 2); 12: Console.WriteLine("x + y = {2} when x = {0} and y = {1}", 1, 2, result); 13: Console.Read(); 14: } 15: } 16: }4IL中国设计秀
四、局限4IL中国设计秀
4IL中国设计秀
这个解决方案有一个很大的局限:服务方式不能包含ref和out参数,因为这两种类型的参数不能作为匿名方法的参数。4IL中国设计秀