呼叫WCF服务问题 [英] Calling WCF service problem
本文介绍了呼叫WCF服务问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我正在从桌面应用程序调用WCF服务.但这给了我错误.如下
Hi guys
I am calling WCF services from my desktop application. But It gives me the error. Which is as follow
"The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."
和堆栈跟踪是
and stack trace is
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)
at System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, 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 NormalFileApplication.ServiceReference1.IService1.fileStoring(Int32 filelength, String filename, Byte[] filedata)
at NormalFileApplication.ServiceReference1.Service1Client.fileStoring(Int32 filelength, String filename, Byte[] filedata) in d:\cm trade application\normalfileapplication\normalfileapplication\service references\servicereference1\reference.cs:line 50
at NormalFileApplication.Form1.button2_Click(Object sender, EventArgs e) in D:\CM Trade Application\NormalFileApplication\NormalFileApplication\Form1.cs:line 49
推荐答案
尝试
如何同步和异步调用WCF服务 [
Try
How to Call WCF Services Synchronously and Asynchronously[^]
这篇关于呼叫WCF服务问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文