问题描述
Hai朋友...
谁能帮忙,我有一个具有多个绑定的WCF服务,例如:basicHttpBinding和netTcpBinding,但是我的WCFService仅支持basicHttpBinding.我在webconfig文件1中为baseAddress ="http://localhost:8471/Design_Time_Addresses/WCFData/Service1"提供了2个BaseAddress,为baseAddress ="net.tcp://localhost:8732/Design_Time_Addresses/WCFData/Service1"提供了2 BaseAddress
但是它显示2个地址的编译错误,如果我给http然后工作正常.
Hai friends...
Can anybody help, i have a WCF Service with multiple bindings,Ex: basicHttpBinding and netTcpBinding, but my WCFService is supporting for basicHttpBinding only. I gave 2 BaseAddress in webconfig file 1 for baseAddress="http://localhost:8471/Design_Time_Addresses/WCFData/Service1" and 2 for baseAddress="net.tcp://localhost:8732/Design_Time_Addresses/WCFData/Service1"
But its showing compile error for 2 addresses, if i give http then working fine.
推荐答案
using( ServiceClient proxy = new ServiceClient())
{
}
您需要利用
you need to make use of
using( ServiceClient proxy = new ServiceClient("Give the name of the binding which u want to use"))
{
}
希望对您有所帮助!.
问候,
-Vinayak
I hope this helps!.
Regards,
-Vinayak
这篇关于WCF多重绑定...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!