消费中承载WAS是一个简单的办法,只涉及几个步骤来清楚说明如下WCF服务。在这里,看看下面来了解这个概念。
代理类和配置文件添加到客户端应用程序。创建MathServiceClient对象,并调用该方法。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespaceWASHostedClient
{
classProgram
{
staticvoid Main(string[] args)
{
MathServiceClient client = newMathServiceClient();
Console.WriteLine("Sum of two number 5,6");
Console.WriteLine(client.Add(5, 6));
Console.ReadLine();
}
}
}
输出将显示如下。
Sum of two number 5.6 11