調(diào)用wcf接口出錯(cuò): 內(nèi)部錯(cuò)誤: MessageContract 的實(shí)例在 http://tempuri.org/IFileStoreService/GetFileResponse 中不能為空?!?”應(yīng)用程序中的服務(wù)器錯(cuò)誤。 值不能為 null。參數(shù)名: 內(nèi)部錯(cuò)誤: MessageContract 的實(shí)例在 http://tempuri.org/IFileStoreService/GetFileResponse 中不能為空。說明: 執(zhí)行當(dāng)前 Web 請(qǐng)求期間,出現(xiàn)未經(jīng)處理的異常。請(qǐng)檢查堆棧跟蹤信息,以了解有關(guān)該錯(cuò)誤以及代碼中導(dǎo)致錯(cuò)誤的出處的詳細(xì)信息。 異常詳細(xì)信息: System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: 值不能為 null。參數(shù)名: 內(nèi)部錯(cuò)誤: MessageContract 的實(shí)例在 http://tempuri.org/IFileStoreService/GetFileResponse 中不能為空。返回文件流,當(dāng)文件不存返回一個(gè)null 時(shí)報(bào)上面錯(cuò)誤。返回對(duì)象數(shù):wcf 接口代碼: 怎么解決接口返回null不報(bào)錯(cuò)?
1 回答

慕村9548890
TA貢獻(xiàn)1884條經(jīng)驗(yàn) 獲得超4個(gè)贊
把Model.FileResponse 這個(gè)數(shù)據(jù)契約里的 CreateTime 改成 CreateTime? 試試。
- 1 回答
- 0 關(guān)注
- 959 瀏覽
添加回答
舉報(bào)
0/150
提交
取消