WCF之net.tcp
自己通过编写WCF服务端,在客户端直接添加服务引用时发现不能引用对netTcpBinding直接引用(net.tcp://127.0.0.1:8081),所以自己找到方法了记录以备不时之需。
服务端配置:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="mexConfig">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://120.25.160.17:8080/" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="MyTcpBinding" maxBufferSize="" maxReceivedMessageSize="" sendTimeout="00:30:00" transferMode="Streamed" >
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="mexConfig" name="WCFService.Service">
<endpoint address="net.tcp://120.25.160.17:8081/" binding="netTcpBinding"
bindingConfiguration="MyTcpBinding" contract="WCFService.IService" />
<endpoint address="net.tcp://120.25.160.17:8081/" binding="netTcpBinding"
bindingConfiguration="MyTcpBinding" contract="WCFService.IMyName" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://120.25.160.17:8081/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
客服端配置:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IService" transferMode="Streamed">
<security mode="None" />
</binding>
<binding name="NetTcpBinding_IMyName" transferMode="Streamed">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://120.25.160.17:8081/" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IService" contract="wcf.IService"
name="NetTcpBinding_IService" />
<endpoint address="net.tcp://120.25.160.17:8081/" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IMyName" contract="wcf.IMyName"
name="NetTcpBinding_IMyName" />
</client>
</system.serviceModel>
</configuration>
WCF之net.tcp的更多相关文章
- WCF 采用net.tcp协议
WCF 采用net.tcp协议实践 概述 与Socket相比,WCF真是爽得不得了,其基本指导思想为SOA——面向服务. 其基本配置在于ABC(Address,Binding,Contract), ...
- 如何在wcf中用net tcp协议进行通讯
快速阅读 如何在wcf中用net tcp协议进行通讯,一个打开Wcf的公共类.比较好好,可以记下来. 配置文件中注意配置 Service,binding,behaviors. Service中配置en ...
- [WCF实践]1.WCF使用net.tcp寄宿到IIS中
一.IIS部分 环境:Windows Server 2008 R2 1.安装WAS,如下图所示: 2.网站net.tcp协议绑定,如下图所示: 3.网站启用net.tcp,如下图所示: 二 ...
- WCF使用net.tcp寄宿到IIS中(转)
一.IIS部分 环境:Windows Server 2008 R2 1.安装WAS,如下图所示: 2.网站net.tcp协议绑定,如下图所示: 3.网站启用net.tcp,如下图所示: 二 ...
- WCF 采用net.tcp协议实践
概述 与Socket相比,WCF真是爽得不得了,其基本指导思想为SOA——面向服务. 其基本配置在于ABC(Address,Binding,Contract),通常,只要这三个因素配置对了,那么,基本 ...
- WCF使用Net.tcp绑定时候出现错误:元数据包含无法解析的引用
在WCF服务编程中,客户端添加引用服务时,出现如下错误: 元数据包含无法解析的引用:“net.tcp://192.168.1.105:1314/LoginService”. 套接字连接已中止.这可能是 ...
- WCF 采用net.tcp协议实践(转)
概述 与Socket相比,WCF真是爽得不得了,其基本指导思想为SOA——面向服务. 其基本配置在于ABC(Address,Binding,Contract),通常,只要这三个因素配置对了,那么,基本 ...
- WCF使用net.tcp传输文件
摘要:今天看了一些官方的资料和配置,简单写了一个WCF服务来传递一个文件,借此看看WCF传输大文件的能力,这里采用的是NetTcp绑定,之所以没有采用 basicHttpBinding是因为考虑这种方 ...
- WCF使用net.tcp寄宿到IIS中
一.IIS部分 1. 安装WAS,如下图所示: 2. 网站net.tcp协议绑定,如下图所示: 3. 网站启用net.tcp,如下图所示: 二.WCF代码部分 1. DesignCaseService ...
随机推荐
- 辛巴学院-Unity-剑英陪你零基础学c#系列(二)顺序
这不是草稿 辛巴学院:正大光明的不务正业. 上一次的教程写出来之后,反馈还是挺多的,有很多都做了修改,也有一些让人崩溃,不得不说上几句.有些人有些很奇怪的地方,你写篇东西,被看了以后不说他感觉怎么 ...
- SharpFileDB - a file database for small apps
SharpFileDB - a file database for small apps 本文中文版在此处. I'm not an expert of database. Please feel fr ...
- Intellij IDEA 13.1.3 创建Java Web项目
作者QQ:1095737364 1. Intellij 编辑工具,找到File-->New Project 2. 打开后点击java-->选中WebApplication 和Java ...
- WCF 安全性 之 None
案例下载 http://download.csdn.net/detail/woxpp/4113172 服务端配置代码 <system.serviceModel> <services& ...
- CI Weekly #3 | 关于微服务、Docker 实践与 DevOps 指南
CI Weekly 围绕『 软件工程效率提升』 进行一系列技术内容分享,包括国内外持续集成.持续交付,持续部署.自动化测试. DevOps 等实践教程.工具与资源,以及一些工程师文化相关的程序员 Ti ...
- WCF学习之旅——第一个WCF示例(二)
第四步:通过自我寄宿的方式寄宿服务 WCF服务需要依存一个运行着的进程(宿主),服务寄宿就是为服务指定一个宿主的过程.WCF是一个基于消息的通信框架,采用基于终结点(Endpoint)的通信手段. 终 ...
- 【夔堂】:程序血泪史之——有一种垃圾语言叫做JavaScript
"Prototype"机制是个半成品OOP,有些文章说这玩意当初为了"简单(编写).容易(学习)"而发明的,但web前端技术发展到今天我们看到,JS显然是需要O ...
- 巧用Ajax的beforeSend 提高用户体验
jQuery是经常使用的一个开源js框架,其中的$.ajax请求中有一个beforeSend方法,用于在向服务器发送请求前执行一些动作.具体可参考jQuery官方文档:http://api.jquer ...
- windows自带记事本导致文本文件(UTF-8编码)开头三个字符乱码问题
在windows平台下,使用系统的记事本以UTF-8编码格式存储了一个文本文件,但是由于Microsoft开发记事本的团队使用了一个非常怪异的行为来保存UTF-8编码的文件,它们自作聪明地在每个文件开 ...
- 创建第一个 vlan network "vlan100" - 每天5分钟玩转 OpenStack(94)
上一节我们在 ML2 配置中 enable 了 vlan network,今天将创建 vlan100 并讨论底层网络变化. 打开菜单 Admin -> Networks,点击 “Create N ...