Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 接收对<;的HTTP响应时出错;部署在IIS上的我的wcf服务>;_Asp.net_Wcf_Web Services - Fatal编程技术网

Asp.net 接收对<;的HTTP响应时出错;部署在IIS上的我的wcf服务>;

Asp.net 接收对<;的HTTP响应时出错;部署在IIS上的我的wcf服务>;,asp.net,wcf,web-services,Asp.net,Wcf,Web Services,当我尝试调用与asp.net服务器端网页位于不同服务器(生产)上的web服务时,它有时会在没有任何异常的情况下执行,有时我会遇到标题中提到的此异常。我已经使用了wshttpbinding。我还发布了完整的堆栈跟踪。但最后一个内部例外是: 无法从传输中读取数据 连接:已创建现有连接 由远程主机强制关闭 根据我的搜索,在某个地方它说这是由于错误的绑定,在某个地方它写的IIS权限被阻塞,还有很小的超时限制。我增加了超时时间,但没有更改绑定和IIS帐户,因为我相信如果出现问题,它甚至不会成功执行一次。这

当我尝试调用与asp.net服务器端网页位于不同服务器(生产)上的web服务时,它有时会在没有任何异常的情况下执行,有时我会遇到标题中提到的此异常。我已经使用了wshttpbinding。我还发布了完整的堆栈跟踪。但最后一个内部例外是:

无法从传输中读取数据 连接:已创建现有连接 由远程主机强制关闭

根据我的搜索,在某个地方它说这是由于错误的绑定,在某个地方它写的IIS权限被阻塞,还有很小的超时限制。我增加了超时时间,但没有更改绑定和IIS帐户,因为我相信如果出现问题,它甚至不会成功执行一次。这种行为非常零星,成功率为50%。另外,一些用户在正常的asp.net调用中也报告了这个问题,这些调用也不涉及wcf

此webservice调用不接受任何参数,也不返回任何数据。(放火后忘记那种场景)

异常消息:

接收请求时出错 HTTP对的响应 . 这可能是由于服务 端点绑定不使用HTTP 协议这也可能是由于 HTTP请求上下文被终止 服务器(可能是由于 服务关闭)。请参阅服务器 日志以获取更多详细信息

堆栈跟踪:

服务器堆栈跟踪:在 System.ServiceModel.Channel.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException,HttpWebRequest请求, HttpAbortReason abortReason)在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan 超时)在 System.ServiceModel.Channels.RequestChannel.Request(消息 消息,TimeSpan超时)位于 System.ServiceModel.Channels.clientrieablechannelbinder
1.requestclientrieablechannelbinder
1.OnRequest(TRequestChannel 频道、消息、时间跨度 超时,屏蔽模式(屏蔽模式)在 System.ServiceModel.Channels.ClientReliableChannelBinder
1.请求(消息
消息,TimeSpan超时,屏蔽模式
屏蔽模式)在
System.ServiceModel.Channel.ClientReliableChannelBinder
1.请求(消息 消息,TimeSpan超时)位于 System.ServiceModel.Security.SecuritySessionClient设置`1.SecurityRequestSessionChannel.Request(消息 消息,TimeSpan超时)位于 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息 消息,TimeSpan超时)位于 System.ServiceModel.Channels.ServiceChannel.Call(字符串 动作,布尔单向, ProxyOperationRuntime操作, 对象[]输入,对象[]输出,时间跨度 超时)在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage 方法调用,ProxyOperationRuntime 操作)在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage (信息)

在[0]处重试异常:在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32类型)at Clickable.Scheduler.BLL.NetsuiteService.INetSuiteCommunicationService.executeADADADNetworkToCustomerTask() 在 Clickable.Scheduler.BLL.Configuration.Tasks.AdNetworkToCustomerTask.Run() 在 Clickable.Scheduler.BLL.Configuration.Tasks.Task.Excecute()

异常消息:底层 连接已关闭:出现意外错误 接收时发生错误

堆栈跟踪:在 System.Net.HttpWebRequest.GetResponse() 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan 超时)

异常消息:无法读取数据 从传输连接:一个 现有连接被强制断开 由远程主机关闭

堆栈跟踪:在 System.Net.Sockets.NetworkStream.Read(字节[]) 缓冲区,Int32偏移量,Int32大小) System.Net.FixedSizeReader.ReadPacket(字节[]) 缓冲区、Int32偏移量、Int32计数)
在 System.Net.Security.\u ssStream.StartFrameHeader(字节[]) 缓冲区,Int32偏移量,Int32计数, AsyncProtocolRequest(异步请求)
在 System.Net.Security.\u ssStream.StartReading(字节[]) 缓冲区,Int32偏移量,Int32计数, AsyncProtocolRequest(异步请求)
在 System.Net.Security.\u ssStream.ProcessRead(字节[]) 缓冲区,Int32偏移量,Int32计数, AsyncProtocolRequest(异步请求)
在System.Net.TlsStream.Read处(字节[]) 缓冲区,Int32偏移量,Int32大小) System.Net.PooledStream.Read(字节[]) 缓冲区,Int32偏移量,Int32大小) System.Net.Connection.SyncRead(HttpWebRequest 请求,布尔userRetrievedStream, 布尔probeRead)

异常消息:一个现有的 连接被服务器强行关闭 远程主机

堆栈跟踪:在 System.Net.Sockets.NetworkStream.Read(字节[]) 缓冲区、Int32偏移量、Int32大小)


我知道这很古老,但对于发现这一点的人来说:我也有同样的例外。我通过在web.config中定义一个跟踪来发现错误

<system.diagnostics>
<sources>
  <source propagateActivity="true" name="System.ServiceModel" switchValue="Information, ActivityTracing">
    <listeners>
      <add type="System.Diagnostics.DefaultTraceListener" name="Default">
        <filter type="" />
      </add>
      <add initializeData="C:/temp/tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener">
        <filter type="" />
      </add>
    </listeners>
  </source>
</sources>
</system.diagnostics>
我必须做:

var persons = (from p in db.Persons
                  select new 
                  {
                      Id = p.Id,
                      Name = p.Name,
                      LastName = p.LastName,
                      Email = p.Email
                  }
              ).AsEnumerable()
                //construct the complex type outside of DB  (to prevent the exception that model cannot be constructed in linq to entities)
                .Select(item =>

                    new Person
                    {
                        Id = item.Id,
                        Name = item.Name,
                        LastName = item.LastName,
                        Email = item.Email
                    }).ToList(); 

            return persons;

我知道这很古老,但对于发现这一点的人来说:我也有同样的例外。我通过在web.config中定义一个跟踪来发现错误

<system.diagnostics>
<sources>
  <source propagateActivity="true" name="System.ServiceModel" switchValue="Information, ActivityTracing">
    <listeners>
      <add type="System.Diagnostics.DefaultTraceListener" name="Default">
        <filter type="" />
      </add>
      <add initializeData="C:/temp/tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener">
        <filter type="" />
      </add>
    </listeners>
  </source>
</sources>
</system.diagnostics>
我必须做:

var persons = (from p in db.Persons
                  select new 
                  {
                      Id = p.Id,
                      Name = p.Name,
                      LastName = p.LastName,
                      Email = p.Email
                  }
              ).AsEnumerable()
                //construct the complex type outside of DB  (to prevent the exception that model cannot be constructed in linq to entities)
                .Select(item =>

                    new Person
                    {
                        Id = item.Id,
                        Name = item.Name,
                        LastName = item.LastName,
                        Email = item.Email
                    }).ToList(); 

            return persons;

很难阅读所有的故事,请格式化您的问题。您能否打开跟踪以查看服务端发生了什么?这里有一个屏幕演示,向您展示了您当时是如何找到此问题的解决方案的?很难阅读所有故事,请格式化您的问题。您能否打开跟踪以查看服务端发生了什么?这里有一个屏幕显示,你当时是如何找到解决这个问题的方法的?