摘要:
1、svcutil.exe工具创建客户端代理类 打开Visual Studio命令提示 svcutil.exe /out:c:\ClientCode.cs /config:c:\app.config http://localhost:8000/Services/service.svc2、代码编写基础通道创建客户端代理类EndpointAddress address = new EndpointAddress("http://localhost/servicemodelsamples/service.svc"); WSHttpBinding binding = new WS. 阅读全文
摘要:
EndpointAddress address = new EndpointAddress("http://localhost/servicemodelsamples/service.svc"); WSHttpBinding binding = new WSHttpBinding(); ChannelFactory<ICalculator> factory = new ChannelFactory<ICalculator>(binding, address); ICalculator channel = factory.Cre... 阅读全文
摘要:
一、在IIS中承载 请确保正确安装和注册IIS和WCF以及WCF HTTP激活组件。 二、在Windows进程激活服务(WAS)中承载 三、在托管应用程序中承载(自承载) using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService))) { serviceHost.Open(); Console.WriteLine("The service is ready."); Cons... 阅读全文