与wcf的物体碰撞

时间:2017-08-05 06:48:45

标签: c# wcf

有人可以解释为什么会这样,我有一个C#后端,我通过WCF连接。在后端,我在同一名称空间中有两个类,它们具有两个具有相同名称的属性。这些类用于单独的对象中。属性的类型是不同的,一个是字符串,一个是对象,但在反序列化对象时似乎存在某种冲突?

当我调用返回对象时,它会返回此随机错误。

This could be due to the service endpoint binding not using the HTTP 
protocol. This could also be due to an HTTP request context being aborted by 
the server (possibly due to the service shutting down). See server logs for 
more details.

以下是类,导致问题的属性是BCIssued

public class Activities
{
    public string ApplicationReceived { get; set; }
    public string PIMGranted { get; set; }
    public Bcgranted[] BCGranted { get; set; }
    public object CCCGranted { get; set; }
  //  public object BCIssued { get; set; }
    public object CCCIssued { get; set; }
}


public class CCC
{
    public string BCIssued { get; set; }
    public string FinalIns { get; set; }
    public string LapsedMonths { get; set; }
    public object WorkStarted { get; set; }
    public object Notified { get; set; }
    public object Lapsed { get; set; }
    public object Extension { get; set; }
}

1 个答案:

答案 0 :(得分:0)

感谢Rene关于WCF日志记录的帖子,我能够打开日志记录并在服务器端发现错误

Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract 
which is not supported. Consider modifying the definition of collection 
'Newtonsoft.Json.Linq.JToken' to remove references to itself.