wcf 关于 wsDualHttpBinding 回调

haroun 2009-02-20 11:54:51
我采用的wsDualHttpBinding绑定来实现回调的,但是在本机测试可以的程序,把服务端部署到服务器后,客户端就不能访问回调服务了.会出现超时现象.
不知各位有没有遇到这种情况.我试着从服务端ping客户端,ping不通,可能就是因为这个不能实现双通道吧?但是用tcp协议是可以,这容易理解,但这不是我要的结果.我希望可以用iis作为服务端,实现双通道,希望各位给点策略!
...全文
680 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
hyq106 2010-09-02
  • 打赏
  • 举报
回复
也遇到这个问题,求高手啊
zmc1234my 2010-08-17
  • 打赏
  • 举报
回复
楼主:
我现在比你好点,能够单向成功(wsDualHttpBinding),就是不能够回调。
开始也出现逆刚才的问题,我把用localhost的地方换成了具体的ip地址就可以实现单向功能了。
jackchjfe 2009-03-08
  • 打赏
  • 举报
回复
最近也遇到这个问题,挺郁闷的。防火墙关掉,给客户端所使用的端口添加所用的端口,也可以。
帮顶,请高手解决这个问题哈
haroun 2009-03-02
  • 打赏
  • 举报
回复
客户端跟服务端都同一个网络中的。
服务端配置文件:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="LoaderServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:9001/" />
</behavior>
<behavior name="NewBehavior">
<serviceMetadata httpGetEnabled="false"/>
<serviceTimeouts transactionTimeout="00:03:00" />
<dataContractSerializer maxItemsInObjectGraph="65536000" />
</behavior>
</serviceBehaviors>

</behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="LoaderDualHttpBindingConfig" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None"></security>
</binding>
</wsDualHttpBinding>

<basicHttpBinding>
<binding name="LoaderHttpBindingConfig" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>


</bindings>
<services>
<service behaviorConfiguration="" name="IisServer.MyServer">
<endpoint binding="wsDualHttpBinding"
bindingConfiguration="LoaderDualHttpBindingConfig" name="IisServer.MyServer"
contract="contract.IContract" />

<!--<endpoint binding="basicHttpBinding"
bindingConfiguration="LoaderHttpBindingConfig" name="IisServer.MyServer"
contract="contract.IContract" />-->
</service>
</services>
</system.serviceModel>

客户端配置文件:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="LoaderServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:9001/" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="LargeQuotaBehavior">
<dataContractSerializer
maxItemsInObjectGraph="100000" />
</behavior>
</endpointBehaviors>

</behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="LoaderDualHttpBindingConfig" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" clientBaseAddress="http://CHENHUIZHONG22:8099">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None"></security>
</binding>
</wsDualHttpBinding>

<basicHttpBinding>
<binding name="LoaderHttpBindingConfig" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>

</bindings>

<client>
<!--<endpoint address="http://localhost:9045/iis/IisServer.svc"
behaviorConfiguration="LargeQuotaBehavior"
binding="basicHttpBinding"
bindingConfiguration="LoaderHttpBindingConfig" contract="contract.IContract"
name="LoaderClientHttp"/>-->
<endpoint address="http://localhost:9045/iis/IisServer.svc" binding="wsDualHttpBinding"
bindingConfiguration="LoaderDualHttpBindingConfig" contract="contract.IContract"
name="LoaderClientDualHttp" />
</client>
</system.serviceModel>
  • 打赏
  • 举报
回复
http不行,tcp肯定不行,http是可以穿过防火墙的,但tcp就有可能不行,你的客户端和服务器是在同一个网络吗?还是在外网?
你贴你的配置吧,极有可能是权限问题,以前我碰到过的,还有就是客户端是vista的话可能也会有这个问题。
haroun 2009-02-26
  • 打赏
  • 举报
回复
我觉得首先是服务器那边可能不允许访问客户端,另外客户端也可能由于各原因比如防火墙什么的。以上的这些问题可以通过配置文件,或者在代码里解决吗?
如果不行的话,只能改用TCp协议了。
  • 打赏
  • 举报
回复
ws是需要身份认证的
  • 打赏
  • 举报
回复
贴下你的配置,估计是权限问题。
宝_爸 2009-02-23
  • 打赏
  • 举报
回复
wsDualHttpBinding应该是基于http的.http协议能通吗?是不是有防火墙啊什么的
haroun 2009-02-23
  • 打赏
  • 举报
回复
看来是不可能的了,
haroun 2009-02-21
  • 打赏
  • 举报
回复
自己顶一下,,,,,,,
wesleyluo 2009-02-21
  • 打赏
  • 举报
回复
帮顶。
haroun 2009-02-21
  • 打赏
  • 举报
回复
再顶

110,570

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧