消費WCF服務託管在Windows啟動服務

消費中承載WAS是一個簡單的辦法,只涉及幾個步驟來清楚說明如下WCF服務。在這裏,看看下麵來瞭解這個概念。

代理類和配置檔添加到客戶端應用程式。創建MathServiceClient對象,並調用該方法。

Consuming WCF hosted in WAS
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();
     }
  }
}

輸出將顯示如下。

Consuming WCF hosted in WAS

上一篇: 自託管消費WCF服務 下一篇: 消費WCF服務託管在Windows服務