为什么要使用WCF绑定? [英] WHY WCF Bindings?

查看:106
本文介绍了为什么要使用WCF绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么要绑定????
使用WCF绑定有什么需要?服务本身不能从地址推断出绑定的类型吗?
例如:
如果地址是net.tcp//sample.svc,则应为tcp绑定;如果地址为http://localhost/wcf.com/sample.svc,则应为http绑定.

生成服务代理时,实际上会自动推断出绑定.
但是,您仍然希望在该绑定中自定义许多属性.

您甚至可以创建自己的绑定.


WHY Bindings????
What is the need to use WCF bindings? Can''t the service itself infer the type of binding from the address ?
For ex:
if the address is net.tcp//sample.svc then it should be tcp binding or if http://localhost/wcf.com/sample.svc then it should be http binding.

解决方案

When you generate a service proxy, the binding is actually automatically inferred.
However, you would still want to customize a number of attributes within that binding.

You could even create your own binding.


这篇关于为什么要使用WCF绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆