Note that there are some explanatory texts on larger screens.

plurals
  1. POAn existing connection was forcibly closed by the remote host in WCF
    primarykey
    data
    text
    <p>I have an abstract class called 'Template' defined as:</p> <pre><code>[DataContract] public abstract class Template { [DataMember] public virtual int? Id { get; set; } [DataMember] public virtual string Title { get; set; } [DataMember] public virtual byte[] TemplateDoc { get; set; } [DataMember] public virtual bool IsSystemTemplate { get; set; } } </code></pre> <p>Two derived classes: UserTemplate and SystemTemplate implements above abstract class, which are defined as:</p> <pre><code>public class UserTemplate : Template { [DataMember] public virtual Int32? OfficeId { get; set; } [DataMember] public virtual Int32? UserId { get; set; } protected UserTemplate() { } public UserTemplate(string title, byte[] templateDoc, string templateDocName, TemplateType templateType, int officeId, int? userId) { this.Title = title; this.TemplateDoc = templateDoc; this.IsSystemTemplate = false; this.OfficeId = officeId; this.UserId = userId; } } public class SystemTemplate : Template { [DataMember] public virtual Int32? MultiListGroupId { get; set; } protected SystemTemplate() { } public SystemTemplate(string title, byte[] templateDoc, string templateDocName, TemplateType templateType, int multiListGroupId) { this.Title = title; this.TemplateDoc = templateDoc; this.IsSystemTemplate = true; this.MultiListGroupId = multiListGroupId; } } </code></pre> <p>Now, when I try to call following service method: </p> <pre><code>List&lt;Template&gt; GetTemplatesByTemplateType(int officeId, int? userId, TemplateType templateType) </code></pre> <p>I get this error:</p> <blockquote> <p>System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host</p> </blockquote> <p>Is it because of the reason that I am trying to return an abstract class?<br> It runs fine if I try to call this method using unit test.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload