2017-11-22 09:37:40.992__ 发送到 net.tcp://localhost:2004/ScheduleService/ 的请求操作在配置的超时(00:01:00)内未收到回复。分配给此操作的时间可能已经是更长超时的一部分。这可能由于服务仍在处理操作或服务无法发送回复消息。请考虑增加操作超时(将通道/代理转换为 IContextChannel 并设置 OperationTimeout 属性)并确保服务能够连接到客户端。
Server stack trace:
在 System.ServiceModel.Dispatcher.DuplexChannelBinder.SyncDuplexRequest.WaitForReply(TimeSpan timeout)
在 System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Automation.ScheduleService.IScheduleService.CheckCarrierId(String carrierid)
在 Automation.ScheduleService.ScheduleServiceClient.CheckCarrierId(String carrierid) 位置 c:\Users\SCH\Desktop\Automation\Automation\Service References\ScheduleService\Reference.cs:行号 581
在 Automation.Form1.S3F17_CarrierCMD(Int32 ulSystemBytes, Object RawData) 位置 c:\Users\SCH\Desktop\Automation\Automation\Form1.cs:行号 2149
WCF Server 端配置
<services>
<service name="Schedule.WCFInterface.ScheduleService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBindConfig" contract="Schedule.WCFInterface.IScheduleService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:2014/ScheduleService/" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:2004/ScheduleService/" />
</baseAddresses>
</host>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<netTcpBinding>
<binding name="netTcpBindConfig" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" portSharingEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<reliableSession enabled="true" inactivityTimeout="00:02:00" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
客户端配置
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IScheduleService">
<reliableSession inactivityTimeout="00:02:00" enabled="true" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:2004/ScheduleService/"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IScheduleService"
contract="ScheduleService.IScheduleService" name="NetTcpBinding_IScheduleService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>