WCF數(shù)據(jù)量在實際應(yīng)用中錯誤解決方法
我們在使用WCF開發(fā)工具進行程序開發(fā)時通常會遇到一些問題需要及時解決。我們今天主要為大家介紹一下WCF數(shù)據(jù)量的出現(xiàn)的一些問題解決方法,希望可以幫助大家從中獲得一些幫助,更加充分的掌握這一方面的知識。
昨天下午在作WCF數(shù)據(jù)量并發(fā)的測試,同時啟動40個客戶端進程,在碰到比較耗時的服務(wù)處理時,IIS服務(wù)器返回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)
通過各種方法監(jiān)控WCF數(shù)據(jù)量的錯誤消息,可是這些出錯的調(diào)用都沒有到達(dá)WCF,所有監(jiān)測WCF的地方和WCF的TraceLog都沒有任何的錯誤。隨后又拿出終極法寶wireshark,抓包也看不到任何錯誤,就是客戶端請求了服務(wù)器一下,然后IIS就返回了403錯誤,并報告上面的異常。
于是把WCF的服務(wù)部署到了Win2003server的iis6下面。這樣程序正常運行不會有任何錯誤。于是查了一下IIS5.1 造成403錯誤的原因。原來是IIS5.1的最大連接數(shù)的問題。于是總結(jié)了一下:
同時修改了幾個方面:
1.windowsXP SP3的TCP連接數(shù),改為512。(有專門的工具破解)
2.WCF數(shù)據(jù)量會話數(shù),調(diào)用數(shù)和實例數(shù)
【編輯推薦】