我有一個REST服務調用WCF服務。 WCf服務中的方法按預期返回數據。這是C#對象的Json格式。底層連接已關閉 - webAPI,WCF
[
{
"$id": "1",
"children": [],
"id": 1,
"name": "1",
"owner": {
"userId": 1,
"username": "testuser",
"firstName": null,
"lastName": null
},
"parent": null,
"permissions": [],
"type": 0
}
]
時,有一個複雜的對象的WCF服務拋出一個錯誤「基礎連接已關閉:連接被意外關閉」
[
{
"$id": "1",
"Children": [
{
"$id": "2",
"Children": [],
"Id": 603268262,
"Name": "testfolder",
"Owner": {
"UserId": 555,
"Username": "testuser",
"FirstName": null,
"LastName": null
},
"Parent": {
"$ref": "1"
},
"Permissions": null,
"Type": 0
}
],
"Id": 1,
"Name": "555",
"Owner": {
"UserId": 555,
"Username": "testuser",
"FirstName": null,
"LastName": null
},
"Parent": null,
"Permissions": null,
"Type": 0
}
]
我已經試過最答案這個SO題。爲什麼只有在返回複雜對象時纔會出現錯誤?