调用wcf接口出错: 内部错误

调用wcf接口出错: 内部错误: MessageContract 的实例在 http://tempuri.org/IFileStoreService/GetFileResponse 中不能为空。

“/”应用程序中的服务器错误。


 

值不能为 null。
参数名: 内部错误: MessageContract 的实例在 http://tempuri.org/IFileStoreService/GetFileResponse 中不能为空。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: 值不能为 null。
参数名: 内部错误: MessageContract 的实例在 http://tempuri.org/IFileStoreService/GetFileResponse 中不能为空。

返回文件流,当文件不存返回一个null 时报上面错误。

返回对象数:

https://img.mukewang.com/5b83c9fd0001bd2703190392.jpg

wcf 接口代码:

https://img1.mukewang.com/5b83ca0900014b7908810503.jpg

 怎么解决接口返回null不报错?


素胚勾勒不出你
浏览 866回答 1
1回答

慕村9548890

把Model.FileResponse 这个数据契约里的 CreateTime 改成 CreateTime?  试试。
打开App,查看更多内容
随时随地看视频慕课网APP