【发布时间】:2014-03-27 07:00:43
【问题描述】:
我尝试了很长时间没有运气的解决方案。
我有带有以下接口的 netnamedpiped 服务
[OperationContract]
[ServiceKnownType(typeof(SubTable))]
float GetValue(Table table);
当我在客户端用 null 调用它时 proxy.GetValue(tbl);
我得到 null expcetion,因为 wcf 不能序列化 null 我希望能够通过执行以下操作来传递 null:
if (tbl!= null)
var result = proxyGetValue(tbl);
else
var result = proxyGetValueWhenNull();
【问题讨论】:
-
你打算用空输入得到什么输出?
-
@shree.pat18 只是服务器内部的逻辑
标签: c# wcf nullreferenceexception