0 Replies Latest reply on Aug 25, 2019 1:52 AM by Shahrami

    System.ServiceModel.CommunicationException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server

    Shahrami Lurker

      Hi everyone . I try to handle my snapshots with .net API but I keep getting these errors. I don't know what I did wrong . someone Please Help me

       

      Here is the hole error: Thanks in advance.

      System.ServiceModel.CommunicationException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

         at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)

         at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

         --- End of inner exception stack trace ---

         at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

         at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)

         at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

         at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

         at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

         at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)

         at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)

         at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)

         --- End of inner exception stack trace ---

         at System.Net.HttpWebRequest.GetResponse()

         at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

         --- End of inner exception stack trace ---

       

      Server stack trace:

         at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)

         at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

         at System.ServiceModel.Channels.RequestChannel.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.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 Vim25Api.VimPortType.WaitForUpdates(ManagedObjectReference _this, String version)

         at AppUtil.ServiceUtil.WaitForValues(ManagedObjectReference objmor, String[] filterProps, String[] endWaitProps, Object[][] expectedVals) in D:\Download\VMware-vSphere-SDK-6.7.0-7970399\SDK\vsphere-ws\dotnet\cs\samples\AppUtil\ServiceUtil.cs:line 1423

         at AppUtil.ServiceUtil.WaitForTask(ManagedObjectReference taskmor) in D:\Download\VMware-vSphere-SDK-6.7.0-7970399\SDK\vsphere-ws\dotnet\cs\samples\AppUtil\ServiceUtil.cs:line 1275

         at VMSnapshot.VMSnapshot.revertSnapshot(ManagedObjectReference vmMor) in C:\Users\P\source\repos\VM-Handler\VMSnapshot.cs:line 82

         at VMSnapshot.VMSnapshot.MMain(String[] args) in C:\Users\P\source\repos\VM-Handler\VMSnapshot.cs:line 306

         at VM_Handler.Program.Main(String[] args) in C:\Users\P\source\repos\VM-Handler\Program.cs:line 122