本节的主要内容:1、通过代理类的方式调用服务操作。2、通过通道的方式调用服务操作。3、代码下载

一、通过代理类的方式调用服务操作(两种方式添加代理类)

1.手动编写代理类,如下:

客户端契约:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ServiceModel;
namespace y.WcfFirst.Client.Proxys
{
    [ServiceContract]
    public interface IHello
    {
        [OperationContract]
        string Say(string name);
    }
}
View Code

相关文章:

  • 2021-11-06
  • 2022-03-08
  • 2021-09-14
  • 2021-06-04
  • 2021-12-26
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-19
  • 2021-09-14
  • 2021-11-28
相关资源
相似解决方案