开发者

callback function cannot accept object as a parameter

I found if I defined callback method like

void  call(object o)

I will received the following error

Unhandled Exception: System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.Se开发者_StackOverflow社区rviceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

if using

void call(string s)

then it is good. Anyone knows the reason.


Yes you can't use object type. Operations (including callbacks) always have to know exact type of parameter otherwise they are not able to perform serialization and deserialization.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜