我们在使用WCF开发工具进行程序开发时通常会遇到一些问题需要及时解决。我们今天主要为大家介绍一下WCF数据量的出现的一些问题解决方法,希望可以帮助大家从中获得一些帮助,更加充分的掌握这一方面的知识。
昨天下午在作WCF数据量并发的测试,同时启动40个客户端进程,在碰到比较耗时的服务处理时,IIS服务器返回403错误。异常信息如下:]
- System.ServiceModel.Security.MessageSecurityException:
- System.Net.HttpWebRequest.GetResponse()
- System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.
HttpChannelRequest.WaitForReply(TimeSpan timeout)- Server stack trace:
- System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication
(HttpWebRequest request, HttpWebResponse response, WebException
responseException, HttpChannelFactory factory)- System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReply
Response(HttpWebRequest request, HttpWebResponse response,
HttpChannelFactory factory, WebException responseException)- System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.
HttpChannelRequest.WaitForReply(TimeSpan timeout)- System.ServiceModel.Channels.RequestChannel.Request(Message message,
TimeSpan timeout)- System.ServiceModel.Dispatcher.RequestChannelBinder.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.ServiceChannel.Call(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs)- 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)- terminal.ViolationService.IViolationService.QueryVioImg(String vioSeq)
- terminal.ViolationService.ViolationServiceClient.QueryVioImg
(String vioSeq),terminal.Program.Main(String[] args)
通过各种方法监控WCF数据量的错误消息,可是这些出错的调用都没有到达WCF,所有监测WCF的地方和WCF的TraceLog都没有任何的错误。随后又拿出终极法宝wireshark,抓包也看不到任何错误,就是客户端请求了服务器一下,然后IIS就返回了403错误,并报告上面的异常。
于是把WCF的服务部署到了Win2003server的iis6下面。这样程序正常运行不会有任何错误。于是查了一下IIS5.1 造成403错误的原因。原来是IIS5.1的最大连接数的问题。于是总结了一下:
同时修改了几个方面:
1.windowsXP SP3的TCP连接数,改为512。(有专门的工具破解)
2.WCF数据量会话数,调用数和实例数
【编辑推荐】