WCF之多个终结点
1.服务端配置如下(一个Service节点下可有多个endpoint,):
<system.serviceModel>
<services>
<service name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="returnFaults">
<endpoint address="http://localhost:8000/GIX4" binding ="customBinding"
bindingConfiguration="compactBindingConfig" contract="Microsoft.ServiceModel.Samples.ICalculator"/>
<endpoint address="basic" binding="basicHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator"></endpoint>
<!--前面加个basic基址就变成了http://localhost:8000/GIX4/basic-->
<endpoint address="secure" binding="wsHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator"></endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/GIX4"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
2. 客户端配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICalculator" />
</basicHttpBinding>
<customBinding>
<binding name="CustomBinding_ICalculator">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_ICalculator" />
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8000/GIX4" binding="customBinding"
bindingConfiguration="CustomBinding_ICalculator" contract="Calculator.Service.ICalculator"
name="CustomBinding_ICalculator" />
<endpoint address="http://localhost:8000/GIX4/basic" binding="basicHttpBinding"
contract="Calculator.Service.ICalculator"
name="basic" />
<endpoint address="http://localhost:8000/GIX4/secure" binding="wsHttpBinding"
contract="Calculator.Service.ICalculator"
name="secure"> <!--加上一个名字-->
<identity>
<userPrincipalName value="chenlh@huawei" />
</identity>
</endpoint>
</client>
</system.serviceModel>
3.客户端声明如下:
CalculatorClient client = new CalculatorClient("basic");
WCF之多个终结点的更多相关文章
- 客服端调用自定义宿主的WCF报错"没有终结点在侦听可以接受消息的http://localhost:8085/mex。这通常是由于不正确的地址或者 SOAP 操作导致的错误"的解决方案。
没有终结点在侦听可以接受消息的http://localhost:8085/mex.这通常是由于不正确的地址或者 SOAP 操作导致的错误. 这个错误是由于没有启动元数据交换终结点(MEX)导致的.在宿 ...
- [SL] Silverlight + WCF Demo项目
I:项目描述:利用 Silverlight+WCF 技术,模拟资源管理器(如图1)功能,通过地址栏输入本地文件夹路径,然后将解析出来的该目录下所有文件(夹)存储到数据库中,然后再加载到界面上显示出来: ...
- WCF入门教程(五)配置文件
WCF入门教程(五)配置文件 服务协定以及实现写好后,需要将相关服务公布出去,就需要HOST来承载,供客户端来调用. 承载服务有两种方式,一种通过配置文件,一种通过代码进行配置.上一章已经介绍了代码方 ...
- WCF
--http://www.doc88.com/p-699300196010.html ---术语 WCF术语 消息(message) 消息是一个独立的数据单元,它可能由几个部分组成,包括消息正文和消息 ...
- 第三讲:WCF介绍(3)
代码 https://yunpan.cn/cPns5DkGnRGNs 密码:3913 前面我们通过一个小的例子,大概了解的WCF. 这里我们补充下 EndPoint 配置 A,B,C 中 ...
- WCF第二天
消息 : 消息是一个独立的数据单元,它可能由几个部分组成,包括消息正文和消息头. 服务 : 服务是一个构造,它公开一个或多个终结点,其中每个终结点都公开一个或多个服务操作. 终结点 ...
- 从开发的角度比较 ASP.NET Web 服务与 WCF
Windows Communication Foundation (WCF) 具有一个 ASP.NET 兼容模式选项,用户使用此选项可以对 WCF 应用程序进行编程和配置,使其像 ASP.NET We ...
- WCF学习心得------(二)设计和实现服务协定
设计和实现服务协定 创建服务协定—WCF术语 消息 消息是一个独立的数据单元,它可能由几个部分组成,包括消息正文和消息头. 服务 服务是一个构造,它公开一个或多个终结点,其中每个终结点都公开一个或多个 ...
- WCF分布式开发步步为赢(4):WCF服务可靠性传输配置与编程开发
今天继续WCF分布式开发步步为赢系列的第4节:WCF服务可靠性传输配置与编程开发.这个章节,我们要介绍什么是WCF服务的可靠性传输,随便介绍网络协议的概念,Web Service为什么不支持可靠性传出 ...
随机推荐
- smartGit30天试用过期
Windows: %APPDATA%\syntevo\SmartGit\OS X: ~/Library/Preferences/SmartGit/Unix/Linux: ~/.smartgit ...
- mysql用户备份与修复
1.修复表repair table tb1 [use frm]; #红色部分代表可添加也可不加, 2.show variables like '%timeout%'; #查询关键字 3. 更改数据, ...
- MongoDb系列
这个系列主要总结学习MongoDb过程中的一些经验. 简单介绍及环境搭建 常用命令 C#驱动及应用 管理工具MongoVUE使用
- [原创]checkstyle下载与安装
checkstyle是一款功能很强的java静态代码检查工具,为eclipse的插件.在网上看了,大致有两种安装方法.第一种 为联网,在eclipse里输入URL下载:另一种为下载好插件后,离线安装. ...
- Windows XP PRO SP3 - Full ROP calc shellcode
/* Shellcode: Windows XP PRO SP3 - Full ROP calc shellcode Author: b33f (http://www.fuzzysec ...
- php解密java的DES加密
echo openssl_decrypt( $密文 ,"des-ecb" , $密钥 );
- C-指针与引用的区别
1. 指针是一个变量,保存一个地址,指向内存中的一个单元.而引用是一个别名. int a = 1; int* p = &a; int b = 1; int& r = b; 2. 指针可 ...
- java 基本类库包的作用
tools.jar:工具类库,它跟我们程序中用到的基础类库没有关系. Jre库包含的jar文件(jdk1.6):resources.jar.rt.jar.jsse.jar.jce.jar.charse ...
- 应用程序池“Classic .NET AppPool”将被自动禁用
原文:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=28972779&id=3868008 服务器 Server 20 ...
- Matlab与C/C++联合编程之Matlab以MEX方式调用C/C++代码(二)
如果我有一个用C语言写的函数,实现了一个功能,如一个简单的函数: double add(double x, double y) { return x + y; } 现在我想要在Matlab中使用它,比 ...