Today I get an error when consuming a web service wcf, the error is as follows:
The service could not be invoked. Possible causes: the service is offline or inaccessible. the client configuration does not match the proxy; The existing proxy is not valid. See the stack trace for more information. To try recovery, start a new proxy, restore the default settings or update the service.
Error receiving HTTP response to link . It may be because the service end link does not use the HTTP protocol. It may also be due to the server overriding an HTTP request context (possibly due to the closure of the service). Check server logs for more information.
Server stack trace: in System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException (WebException WebException, HttpWebRequest request, HttpAbortReason abortReason) in System.ServiceModel.Channels.HttpChannelFactory'1.HttpRequestChannel.HttpChannelRequest.WaitForReply (TimeSpan timeout) in System.ServiceModel.Channels.RequestChannel.Request (Message message, TimeSpan timeout) in System.ServiceModel.Dispatcher.RequestChannelBinder.Request (Message message, TimeSpan timeout) in System.ServiceModel.Channels.ServiceChannel.Call (String action, Boolean oneway, ProxyOperationRuntime operation, Object [] ins, Object [] outs, TimeSpan timeout) in System.ServiceModel.Channels.ServiceChannelProxy.InvokeService (IMethodCallMessage methodCall, ProxyOperationRuntime operation) in System.ServiceModel.Channels.ServiceChannelProxy.Invoke (IMessage message)
Exception rethrown at [0]: in System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage (IMessage reqMsg, IMessage retMsg) in System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData & msgData, Int32 type) in IOperacionService.Test () in OperationServiceClient.Test ()
Inner Exception: The connection is terminated: Unexpected reception error. in System.Net.HttpWebRequest.GetResponse () in System.ServiceModel.Channels.HttpChannelFactory'1.HttpRequestChannel.HttpChannelRequest.WaitForReply (TimeSpan timeout)
Inner Exception: Unable to write data to the transport connection: The interruption of an existing connection by the remote host has been forced. in System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size) in System.Net.PooledStream.Read (Byte [] buffer, Int32 offset, Int32 size) in System.Net.Connection.SyncRead (HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
Inner Exception: The interruption of an existing connection has been forced by the remote host in System.Net.Sockets.Socket.Receive (Byte [] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) in System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size)
The entity to be returned is a self-generated entity by EntityFramework 6.2
public partial class Proceso
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Proceso()
{
this.ClasificacionDocumento = new HashSet<ClasificacionDocumento>();
}
public int IDProceso { get; set; }
public string Proceso { get; set; }
public string CODHomologacion { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ClasificacionDocumento> ClasificacionDocumento { get; set; }
}
and The service has the following implementation
public List<Proceso> Test()
{
List<Proceso> ls = new List<Proceso>();
Proceso tp = new Proceso();
DBContext psg = new DBContext();
tp = psg.Set<Proceso>().Find(0);
ls.Add(tp);
return ls;
}
}
The service fails to return the data, the objects are created and filled correctly, and the list until before the return is correct and contains an element.
I appreciate your help.