关于wcf中wsDualHttpBinding的问题

lyonyf 2008-03-19 12:57:07
利用wcf的回调机制,编写程序时,把服务发布到本地的IIS上调试没有问题,但发布到别的机器上,进行局域网内调试时,连接一直不能打开,报错为:
绑定类型:wsDualHttpBinding时出错,basicHttpBinding,wsHttpBinding时正常通信。

System.TimeoutException: The open operation did not complete within the allotted timeout of 00:05:00. The time allotted to this operation may have been a portion of a longer timeout.\r\n\r\nServer stack trace: \r\n at System.ServiceModel.Channels.ReliableRequestor.Request(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CreateSequenceReliableRequestor.RequestCreateSequence(UniqueId offerId, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)\r\n at System.ServiceModel.Channels.ClientReliableDuplexSessionChannel.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)\r\n at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n at ClientTest.boxianli_dev_beijing_demetersoft_com.IService1.MyOperation1(String myValue)\r\n at ClientTest.boxianli_dev_beijing_demetersoft_com.Service1Client.MyOperation1(String myValue) in D:\\workspace\\studyProject\\2008-2-19\\wcf\\basicwcf\\WcfServiceTest\\ClientTest\\Service References\\boxianli-dev.beijing.demetersoft.com.cs:line 119\r\n at ClientTest.Form1.button1_Click(Object sender, EventArgs e) in D:\\workspace\\studyProject\\2008-2-19\\wcf\\basicwcf\\WcfServiceTest\\ClientTest\\Form1.cs:line 28"
...全文
300 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
子在川上笑 2012-05-20
  • 打赏
  • 举报
回复
更改配置文件app.config
<system.serviceModel>
<services>
<service name="WcfServiceLibrary1.MathService">
<endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary1.IMathService">

将binding="wsHttpBinding"改为 binding="wsDualHttpBinding"就行了,为双工模式!
lyonyf 2008-05-15
  • 打赏
  • 举报
回复
我的那个问题的原因是配置文件中clientAddress的值设置为localhost:端口号,如果把localhost改为(相应机器)机器名,就可以了。
ZJ_CHENBF2008 2008-05-04
  • 打赏
  • 举报
回复
我遇到了你同样的问题,请问你有解决方法了吗?
lhzyn 2008-03-20
  • 打赏
  • 举报
回复
把配置文件发来看看。
lyonyf 2008-03-19
  • 打赏
  • 举报
回复
第一次发帖,请多指教:
错误提示整理了一下:

System.TimeoutException: The open operation did not complete within the allotted timeout of 00:05:00. The time allotted to this operation may have been a portion of a longer timeout.

Server stack trace:
at System.ServiceModel.Channels.ReliableRequestor.Request(TimeSpan timeout)
at System.ServiceModel.Channels.CreateSequenceReliableRequestor.RequestCreateSequence(UniqueId offerId, TimeSpan timeout)
at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ClientReliableDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ClientTest.boxianli_dev_beijing_demetersoft_com.IService1.MyOperation1(String myValue)
at ClientTest.boxianli_dev_beijing_demetersoft_com.Service1Client.MyOperation1(String myValue) in D:\\workspace\\studyProject\\2008-2-19\\wcf\\basicwcf\\WcfServiceTest\\ClientTest\\Service References\\boxianli-dev.beijing.demetersoft.com.cs:line 119
at ClientTest.Form1.button1_Click(Object sender, EventArgs e) in D:\\workspace\\studyProject\\2008-2-19\\wcf\\basicwcf\\WcfServiceTest\\ClientTest\\Form1.cs:line 28"
drummery 2008-03-19
  • 打赏
  • 举报
回复
友情帮顶
lyonyf 2008-03-19
  • 打赏
  • 举报
回复
自己先顶一下。

110,533

社区成员

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

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

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