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 ...
随机推荐
- SOA相关资料整理分享
昨@幸福框架同学问能否推荐SOA一些资,.想想之前看过不少资料文档,就整理分享下,有需要的可以参考下. 文章链接 理解面向服务的体系结构中企业服务总线场景和解决方案,第 1 部分 SOA 和 web ...
- Python读取二进制文件
import os import sys import socket mypath = sys.argv[1] if not os.path.exists(mypath): print "T ...
- C#中,使用正式表达式匹配获取所需数据
.NET中,使用正式表达式匹配获取所需数据 需求:获取一串字符串中,正则匹配出需要的数据. 例如以下字符串: string temp ="ErrorCode:-1,Message:{&quo ...
- 《JS修炼之道》—— 读后总结
本篇是基于<JS修炼之道>的记录性与总结性的文章,这本书从多种框架的角度,讲述了JS开发中的一些实用技巧. 比如Prototype,JQuery,Mootools,YUI,Dojo,Ext ...
- JSP的基本语法
JSP的基本语法 一.JSP页面中的JAVA代码 二.JSP页面中的指令 三.JSP页面中的隐含对象(九大内置对象) 目录 一.JSP页面中的JAVA代码 JSP表达式(方便输出) JSP小脚本(完成 ...
- WPF入门教程系列二十——ListView示例(二)
第四步.WPF后台逻辑代码编写 在后台用Entity Framework 6.1的Code First方式获取数据库中的数据.同时,在“刷新”按钮的方法中进行数据绑定.操作步骤如下: 1) 在“刷新 ...
- python网络编程——IO多路复用之epoll
1.内核EPOLL模型讲解 此部分参考http://blog.csdn.net/mango_song/article/details/42643971博文并整理 首先我们来定义流的概念,一个流 ...
- win7+IIS7下木有4.0框架问题的解决方案
- OpenCASCADE Make Primitives-Box
OpenCASCADE Make Primitives-Box eryar@163.com Abstract. By making a simple box to demonstrate the BR ...
- Android性能优化之UncaughtExceptionHandler定制自己的错误日志系统
前言: 每当我们app测试的时候,测试人员总是对我们说这里崩溃了,那里挂掉了!我们只能默默接受,然后尝试着重现bug,更可悲的是有时候bug很难复现,为了解决这种现状所以我们要尝试这建立一个自己的bu ...