首页 新闻 会员 周边 捐助

WCF 超时异常

0
悬赏园豆:50 [已关闭问题] 关闭于 2010-05-13 14:26

服务器端配置

<configuration>
<appSettings>
<add key="RandomDataPointFrequencyInMilliseconds" value="100"/>
</appSettings>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<!-- 将下列元素添加到服务行为配置中。 -->
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="httpconf">
<security mode="None">
<message clientCredentialType="None" negotiateServiceCredential="false"/>
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<services>
<service name="PublicationSubscription.PublisherService" behaviorConfiguration="MyServiceTypeBehaviors">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9000/Server/"/>
</baseAddresses>
</host>
<endpoint
address
="Publisher"
binding
="wsDualHttpBinding"
contract
="PublicationSubscription.IPublisher"
bindingConfiguration
="httpconf"
/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
</configuration>

客户端配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint name="SubscriptionService"
address
="http://localhost:9000/Server/Publisher"
binding
="wsDualHttpBinding"
bindingConfiguration
="SubscriberBindingConfiguration"
contract
="PublicationSubscription.IPublisher"
/>
</client>
<bindings>
<wsDualHttpBinding>
<binding name="SubscriberBindingConfiguration"
clientBaseAddress
="http://localhost:9001/Subscriber">
<security mode="None">
<message clientCredentialType="None" negotiateServiceCredential="false"/>
</security>
</binding>
</wsDualHttpBinding>
</bindings>
</system.serviceModel>
</configuration>

在本地运行一切正常,但把WCF宿主运行于服务器,客户端在本地打开时就报错,错误内容如下:
message:
"打开操作没有在分配的超时 00:00:59.7031250 内完成。分配给该操作的时间可能是更长超时的一部分。"
StackTrace:

Server stack trace:
   在 System.ServiceModel.Channels.ReliableRequestor.ThrowTimeoutException()
   在 System.ServiceModel.Channels.ReliableRequestor.Request(TimeSpan timeout)
   在 System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)
   在 System.ServiceModel.Channels.ClientReliableDuplexSessionChannel.OnOpen(TimeSpan timeout)
   在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   在 System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

Len Shen的主页 Len Shen | 初学一级 | 园豆:100
提问于:2010-05-13 10:35
< >
分享
所有回答(2)
0

防火墙?

周巍 | 园豆:735 (小虾三级) | 2010-05-13 10:59
你说的服务端防火墙还是本地防火墙?
支持(0) 反对(0) Len Shen | 园豆:100 (初学一级) | 2010-05-13 11:01
服务端的WCF服务,我用本地浏览器浏览一切正常,而本地防火墙我都关闭了再测,还是一样的结果,郁闷!!!
支持(0) 反对(0) Len Shen | 园豆:100 (初学一级) | 2010-05-13 11:02
0

楼主上面的问题如何解决? 我也郁闷中呀。。。。

蔡风 | 园豆:218 (菜鸟二级) | 2011-11-04 16:26

换成nettcp试试

支持(0) 反对(0) Len Shen | 园豆:100 (初学一级) | 2011-11-04 21:06
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册